mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
New implementation of GetAbsoluteUrlRootPath that no longer requires any parameter.
SVN:trunk[1287]
This commit is contained in:
@@ -390,12 +390,16 @@ class utils
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the absolute URL to the server's root path
|
* 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
|
* @param $bForceHTTPS bool True to force HTTPS, false otherwise
|
||||||
* @return string The absolute URL to the server's root, without the first slash
|
* @return string The absolute URL to the server's root, without the first slash
|
||||||
*/
|
*/
|
||||||
static public function GetAbsoluteUrlAppRoot($sCurrentRelativePath = '', $bForceHTTPS = false)
|
static public function GetAbsoluteUrlAppRoot($sCurrentRelativePath = '', $bForceHTTPS = false)
|
||||||
{
|
{
|
||||||
$sAbsoluteUrl = self::GetAbsoluteUrl(false, $bForceHTTPS); // False => Don't get the query string
|
$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);
|
$sAppRootPos = strpos($sAbsoluteUrl, $sCurrentRelativePath);
|
||||||
if ($sAppRootPos !== false)
|
if ($sAppRootPos !== false)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user