Replace on SCRIPT_FILENAME

By replacing on this rather than __FILE__, we have a full file path and
can actually exclude the current working folder
This commit is contained in:
Matt Pass
2014-01-16 14:15:34 +00:00
parent 58e7c5ec42
commit bfea966a14

View File

@@ -79,7 +79,7 @@ if ($_SESSION['loggedIn']) {
}
// Establish the dir ICEcoders running from
$ICEcoderDirFullPath = rtrim(str_replace("\\","/",dirname(__FILE__)),"/lib");
$ICEcoderDirFullPath = rtrim(str_replace("\\","/",dirname($_SERVER['SCRIPT_FILENAME'])),"/lib");
$rootPrefix = '/'.str_replace("/","\/",preg_quote(str_replace("\\","/",$docRoot))).'/';
$ICEcoderDir = preg_replace($rootPrefix, '', $ICEcoderDirFullPath, 1);