Added SYS[requestURIvar] to get original value of REQUEST_URI (needed by some URL...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_div.php
index 874929d..3346d1f 100755 (executable)
@@ -3068,7 +3068,10 @@ class t3lib_div {
                        break;
                        case 'REQUEST_URI':
                                        // Typical application of REQUEST_URI is return urls, forms submitting to itself etc. Example: returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))
-                               if (!$_SERVER['REQUEST_URI'])   {       // This is for ISS/CGI which does not have the REQUEST_URI available.
+                               if ($GLOBALS['TYPO3_CONF_VAR']['SYS']['requestURIvar']) {       // This is for URL rewriters that store the original URI in a server variable (eg ISAPI_Rewriter for IIS: HTTP_X_REWRITE_URL)
+                                       list($v,$n) = explode('|',$GLOBALS['TYPO3_CONF_VAR']['SYS']['requestURIvar']);
+                                       $retVal = $GLOBALS[$v][$n];
+                               } elseif (!$_SERVER['REQUEST_URI'])     {       // This is for ISS/CGI which does not have the REQUEST_URI available.
                                        $retVal = '/'.ereg_replace('^/','',t3lib_div::getIndpEnv('SCRIPT_NAME')).
                                                ($_SERVER['QUERY_STRING']?'?'.$_SERVER['QUERY_STRING']:'');
                                } else $retVal = $_SERVER['REQUEST_URI'];
@@ -4585,7 +4588,7 @@ class t3lib_div {
 
 
        /**
-        * Quotes a string for usage as JS parameter. Depends wheter the value is used in script tags (it doesn't need/must not get htmlspecialchared in this case)
+        * Quotes a string for usage as JS parameter. Depends wheter the value is used in script tags (it doesn't need/must not get htmlspecialchar'ed in this case)
         *
         * @param       string          The string to encode.
         * @param       boolean         If the values get's used in <script> tags.