• Main Page
  • Related Pages
  • Classes
  • Files
  • Directories
  • File List
  • File Members

oxid.php

Go to the documentation of this file.
00001 <?php
00002 
00007 // set the HTTP GET parameters manually if search_engine_friendly_urls is enabled
00008 if ( isset( $_SERVER["REQUEST_URI"]) && $_SERVER["REQUEST_URI"]) {
00009     $sParams = $_SERVER["REQUEST_URI"];
00010 } else {
00011     // try something else
00012     $sParams = $_SERVER["SCRIPT_URI"];
00013 }
00014 
00023 function getRequestUrl( $sParams = '', $blReturnUrl = false )
00024 {
00025     static $sProcUrl = null;
00026 
00027     if ( $blReturnUrl ) {
00028         return 'index.php?' . trim( $sProcUrl, '&amp;' );
00029     } else {
00030         $sProcUrl = '';
00031     }
00032 
00033     $sScriptFile = basename(__FILE__);
00034     $iPos = strpos( $sParams, $sScriptFile);
00035     $sParams = substr( $sParams, $iPos + strlen($sScriptFile));
00036     $sParams = str_replace("_&2f", "%2f", $sParams);  // #1123A
00037 
00038     //searchengine url safe replace
00039     $aReplaceArray = array( "/?" => "/",
00040                         "?" => "/",
00041                         "/&" => "/",
00042                         "&" => "/",
00043                         "=/" => "/-/",
00044                         "=" => "/");
00045     $sParams = strtr($sParams, $aReplaceArray);
00046 
00047 
00048     $aArg = explode( "/", $sParams);
00049 
00050 
00051     $sSizeofArg = count($aArg);
00052     for ($iCtr = 0; $iCtr < $sSizeofArg; $iCtr++) {
00053         $sParam = $aArg[$iCtr];
00054         if ( !$sParam || strstr( $sParam, $sScriptFile)) {
00055             continue;
00056         }
00057 
00058         // sets value "-" (or other) to empty, according to change
00059         // in index.php line 512 (described)
00060         $sEmptyVar = "-";
00061         if ( !isset($aArg[$iCtr+1]) || $aArg[$iCtr+1] == $sEmptyVar) {
00062             $aArg[$iCtr+1] = "";
00063         }
00064 
00065         if ( strpos(rawurldecode($aArg[$iCtr]), "[") !== false && preg_match( "/.*\[.*\]/", rawurldecode($aArg[$iCtr]))) {
00066             $sVar = rawurldecode($aArg[$iCtr]);
00067             $sName = preg_replace( "/\[.*\]/", "", $sVar);
00068             $sKey  = preg_replace( array( "/.*\[/", "/\]/"), "", $sVar);
00069             $aArray[$sKey] = $aArg[$iCtr+1];
00070             @$_GET[$sName] = $aArray;
00071             @$_REQUEST[$sName] = $aArray;
00072 
00073             $sProcUrl .= "{$sName}[{$sKey}]=".$aArg[$iCtr+1]."&amp;";
00074         } else {
00075             @$_GET[$aArg[$iCtr]] = rawurldecode($aArg[$iCtr+1]);
00076             @$_REQUEST[$aArg[$iCtr]] = rawurldecode($aArg[$iCtr+1]);
00077 
00078             // skipping session id
00079             if ( $aArg[$iCtr] != 'sid' && $aArg[$iCtr+1] ) {
00080                 $sProcUrl .= $aArg[$iCtr]."=".$aArg[$iCtr+1]."&amp;";
00081             }
00082         }
00083         $iCtr++;
00084     }
00085 }
00086 
00087 if ( isset( $sParams ) && $sParams && $_SERVER["REQUEST_METHOD"] != "POST" ) {
00088     getRequestUrl( $sParams );
00089 }
00090 
00094 require "index.php";

Generated by  doxygen 1.7.1