mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-15 04:47:05 +01:00
preg_replace to remove full path prefix
Use preg_replace to only replace the first instance on a full path to make it local Avoids str_replace replacing all instances in the string
This commit is contained in:
@@ -79,7 +79,9 @@ if ($_SESSION['loggedIn']) {
|
||||
}
|
||||
|
||||
// Establish the dir ICEcoders running from
|
||||
$ICEcoderDir = rtrim(str_replace(str_replace("\\","/",$docRoot),"",str_replace("\\","/",dirname(__FILE__))),"/lib");
|
||||
$ICEcoderDirFullPath = rtrim(str_replace("\\","/",dirname(__FILE__)),"/lib");
|
||||
$rootPrefix = '/'.str_replace("/","\/",preg_quote(str_replace("\\","/",$docRoot))).'/';
|
||||
$ICEcoderDir = preg_replace($rootPrefix, '', $ICEcoderDirFullPath, 1);
|
||||
|
||||
// Setup our file security vars
|
||||
$settingsArray = array("findFilesExclude","bannedFiles","allowedIPs");
|
||||
|
||||
Reference in New Issue
Block a user