diff --git a/catalog/admin/includes/application_top.php b/catalog/admin/includes/application_top.php index c3e838d1b..443f2095b 100644 --- a/catalog/admin/includes/application_top.php +++ b/catalog/admin/includes/application_top.php @@ -40,7 +40,7 @@ // set php_self in the local scope $req = parse_url($_SERVER['SCRIPT_NAME']); - $PHP_SELF = substr($req['path'], ($request_type == 'SSL') ? strlen(DIR_WS_HTTPS_ADMIN) : strlen(DIR_WS_ADMIN)); + $PHP_SELF = str_replace(($request_type == 'SSL') ? DIR_WS_HTTPS_ADMIN : DIR_WS_ADMIN, '', $req['path']); // Used in the "Backup Manager" to compress backups define('LOCAL_EXE_GZIP', 'gzip'); diff --git a/catalog/includes/application_top.php b/catalog/includes/application_top.php index 35a209208..8f3c8cb02 100644 --- a/catalog/includes/application_top.php +++ b/catalog/includes/application_top.php @@ -50,7 +50,7 @@ // set php_self in the local scope $req = parse_url($_SERVER['SCRIPT_NAME']); - $PHP_SELF = substr($req['path'], ($request_type == 'NONSSL') ? strlen(DIR_WS_HTTP_CATALOG) : strlen(DIR_WS_HTTPS_CATALOG)); + $PHP_SELF = str_replace(DIR_WS_CATALOG, '', $req['path']); // include the list of project filenames require('includes/filenames.php');