Permalink
Browse files

Base PHP_SELF on SCRIPT_NAME/SCRIPT_FILENAME

  • Loading branch information...
1 parent b858db1 commit 64f5acea030c1aea58f32200b285b304c8b0f8eb @haraldpdl haraldpdl committed Sep 9, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 catalog/admin/includes/application_top.php
  2. +1 −1 catalog/includes/application_top.php
@@ -34,7 +34,7 @@
require(DIR_WS_FUNCTIONS . 'compatibility.php');
// set php_self in the local scope
- $PHP_SELF = $_SERVER['SCRIPT_FILENAME'];
+ $PHP_SELF = (isset($HTTP_SERVER_VARS['SCRIPT_NAME']) ? basename($HTTP_SERVER_VARS['SCRIPT_NAME']) : basename($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
// Used in the "Backup Manager" to compress backups
define('LOCAL_EXE_GZIP', 'gzip');
@@ -43,7 +43,7 @@
$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
// set php_self in the local scope
- if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
+ $PHP_SELF = (isset($HTTP_SERVER_VARS['SCRIPT_NAME']) ? basename($HTTP_SERVER_VARS['SCRIPT_NAME']) : basename($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
if ($request_type == 'NONSSL') {
define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);

0 comments on commit 64f5ace

Please sign in to comment.