PHP5 fixes

This commit is contained in:
Lars Kneschke 2005-12-20 17:45:47 +00:00
parent 40f5256cee
commit 8d704fe5c0

View File

@ -39,7 +39,8 @@
// variable uses forward slashes. If it does not, you'll have to tweak // variable uses forward slashes. If it does not, you'll have to tweak
// this. // this.
if (isset($_SERVER['PHP_SELF'])) { if (isset($_SERVER['PHP_SELF'])) {
$webroot = strstr(dirname(__FILE__), '/' . array_shift(preg_split(';/;', $_SERVER['PHP_SELF'], 2, PREG_SPLIT_NO_EMPTY))); $parts = preg_split(';/;', $_SERVER['PHP_SELF'], 2, PREG_SPLIT_NO_EMPTY);
$webroot = strstr(dirname(__FILE__), '/' . array_shift($parts));
if ($webroot !== false) { if ($webroot !== false) {
$webroot = preg_replace(';/config$;', '', $webroot); $webroot = preg_replace(';/config$;', '', $webroot);
} else { } else {