mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
For the setup: try to make the URL detection work even if the actual PHP file is not part of the URL (i.e when index.php is implicitely added when browsing a folder)
SVN:trunk[1347]
This commit is contained in:
@@ -419,7 +419,18 @@ class utils
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Failed to determine application root path $sAbsoluteUrl ($sCurrentRelativePath) APPROOT:'$sAppRoot'");
|
||||
// Second attempt without index.php at the end...
|
||||
$sCurrentRelativePath = str_replace('index.php', '', $sCurrentRelativePath);
|
||||
$sAppRootPos = strpos($sAbsoluteUrl, $sCurrentRelativePath);
|
||||
if ($sAppRootPos !== false)
|
||||
{
|
||||
$sAppRootUrl = substr($sAbsoluteUrl, 0, $sAppRootPos); // remove the current page and path
|
||||
}
|
||||
else
|
||||
{
|
||||
// No luck...
|
||||
throw new Exception("Failed to determine application root path $sAbsoluteUrl ($sCurrentRelativePath) APPROOT:'$sAppRoot'");
|
||||
}
|
||||
}
|
||||
return $sAppRootUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user