summaryrefslogtreecommitdiffstats
path: root/templates/list_header.inc
diff options
context:
space:
mode:
Diffstat (limited to 'templates/list_header.inc')
-rw-r--r--templates/list_header.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/templates/list_header.inc b/templates/list_header.inc
index 58c7fa61..257c5220 100644
--- a/templates/list_header.inc
+++ b/templates/list_header.inc
@@ -88,8 +88,16 @@ while ($page <= $pages) {
ksort($page_data['up']);
ksort($page_data['down']);
-/* Take the script name and passed action and setup the next action */
+/* Detect the current script, this take a little work because we have to
+ * account for FastCGI
+ */
preg_match("/.*\/(.+\.php)$/", $_SERVER['SCRIPT_NAME'], $matches);
+// Must be running Fast CGI or something similar
+if (!isset($matches['1'])) {
+ // Try PHP_SELF
+ preg_match("/.*\/(.+\.php)$/",$_SERVER['PHP_SELF'],$matches);
+}
+
$action = "action=" . scrub_in($_REQUEST['action']);
$script = conf('web_path') . "/" . $admin_menu . $matches[1];