git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4368 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-07-16 03:49:04 +00:00
parent c8e9338c07
commit e8d0fc5101

View file

@ -515,11 +515,7 @@
**/
function getScriptPath() {
static $url = null;
if($url === null) {
$document_root = str_replace('\\','/',realpath($_SERVER['DOCUMENT_ROOT']));
$file = str_replace('\\','/',__FILE__);
$url = preg_replace('/index.php/i','',str_replace('config/func.inc.php','',str_replace($document_root, '', $file)));
}
if($url == null) $url = preg_replace('/index.php$/i','',str_replace('\\','/',$_SERVER['SCRIPT_NAME']));
return $url;
}