From e6a2917b9de293e735df5dbf0b10dce967185f45 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Wed, 17 Apr 2013 10:35:00 -0400 Subject: [PATCH] Fix in ispconfig url detection function when nginx returns '_' as $_SERVER['SERVER_NAME'] --- interface/lib/classes/aps_guicontroller.inc.php | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/interface/lib/classes/aps_guicontroller.inc.php b/interface/lib/classes/aps_guicontroller.inc.php index 4d0cf4b..49393bd 100644 --- a/interface/lib/classes/aps_guicontroller.inc.php +++ b/interface/lib/classes/aps_guicontroller.inc.php @@ -728,6 +728,8 @@ // Using parse_url() to filter malformed URLs $path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'. basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$icon); + // nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path + $path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path); $pkg['Icon'] = $path; } else $pkg['Icon'] = ''; @@ -741,6 +743,8 @@ // Using parse_url() to filter malformed URLs $path = dirname(parse_url($_SERVER['PHP_SELF'], PHP_URL_PATH)).'/'. basename($this->interface_pkg_dir).'/'.$pkg['path'].'/'.basename((string)$screen['path']); + // nginx: if $_SERVER['PHP_SELF'] is doubled, remove /sites/aps_packagedetails_show.php from beginning of path + $path = preg_replace('@^/sites/aps_packagedetails_show.php(.*)@', '$1', $path); $pkg['Screenshots'][] = array('ScreenPath' => $path, 'ScreenDescription' => htmlspecialchars(trim((string)$screen->description))); -- Gitblit v1.9.1