From 7bcb4ed3b229f7f5a315099fb455dbd2cd7ebe4b Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 20 Jun 2011 14:18:24 +0000 Subject: [PATCH] New implementation of GetAbsoluteUrlRootPath that no longer requires any parameter. SVN:trunk[1287] --- application/utils.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/utils.inc.php b/application/utils.inc.php index 078e63b46..b26e1f147 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -390,12 +390,16 @@ class utils /** * Returns the absolute URL to the server's root path + * @param $sCurrentRelativePath string NO MORE USED, kept for backward compatibility only ! * @param $bForceHTTPS bool True to force HTTPS, false otherwise * @return string The absolute URL to the server's root, without the first slash */ static public function GetAbsoluteUrlAppRoot($sCurrentRelativePath = '', $bForceHTTPS = false) { $sAbsoluteUrl = self::GetAbsoluteUrl(false, $bForceHTTPS); // False => Don't get the query string + $sCurrentScript = realpath($_SERVER['SCRIPT_FILENAME']); + $sCurrentRelativePath = str_replace(APPROOT, '', $sCurrentScript); + $sAppRootPos = strpos($sAbsoluteUrl, $sCurrentRelativePath); if ($sAppRootPos !== false) {