Cache $PHP_SELF value, add ability to make custom changes to $PHP_SELF by putting...
[squirrelmail.git] / functions / strings.php
index ddb13b2a0713ab7ac9c6123ab9670df7796d69fb..9e295df6dfe18fb299a7aa5e93105491596cb626 100644 (file)
@@ -474,12 +474,7 @@ function get_location () {
            $is_secure_connection, $sq_ignore_http_x_forwarded_headers;
 
     /* Get the path, handle virtual directories */
-    if(strpos(php_self(), '?')) {
-        $path = substr(php_self(), 0, strpos(php_self(), '?'));
-    } else {
-        $path = php_self();
-    }
-    $path = substr($path, 0, strrpos($path, '/'));
+    $path = substr(php_self(FALSE), 0, strrpos(php_self(FALSE), '/'));
 
     // proto+host+port are already set in config:
     if ( !empty($config_location_base) ) {