Pārlūkot izejas kodu

New implementation of GetAbsoluteUrlRootPath that no longer requires any parameter.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1287 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 gadi atpakaļ
vecāks
revīzija
243084c1f4
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      application/utils.inc.php

+ 4 - 0
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)
 		{