--- mambo/branches/4.6/includes/core.classes.php 2008/05/01 23:07:13 1690 +++ mambo/branches/4.6/includes/core.classes.php 2008/05/03 03:41:39 1691 @@ -336,20 +336,18 @@ fclose($f); eval($code); - - /*if (isset($_SERVER['DOCUMENT_ROOT']) AND strlen($_SERVER['DOCUMENT_ROOT'])) { - $docroot = str_replace('\\', '/', str_replace('\\\\', '\\', $_SERVER['DOCUMENT_ROOT'])); + $origin = array_pop(debug_backtrace()); + // Find the PHP script at the start, with a fix for Windows slashes + $absolutepath = str_replace('\\', '/', $origin['file']); + $localpath = $_SERVER['PHP_SELF']; + $userdir= ''; + if (strpos($localpath,'~') !== false){ + $userdir = substr($localpath, 0, strpos(substr($localpath,1),'/')+1); + $localpath = substr($localpath,strpos(substr($localpath,1),'/')+1); } - else {*/ - // Find information about where execution started - $origin = array_pop(debug_backtrace()); - // Find the PHP script at the start, with a fix for Windows slashes - $absolutepath = str_replace('\\', '/', $origin['file']); - $localpath = $_SERVER['PHP_SELF']; - $docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); - /*}*/ + $docroot = substr($absolutepath,0,strpos($absolutepath,$localpath)); $mamboroot = str_replace('\\', '/', rtrim($this->rootPath, '\/')); - $this->subdirectory = substr($mamboroot, strlen($docroot)); + $this->subdirectory = $userdir . substr($mamboroot, strlen($docroot)); $scheme = isset($_SERVER['HTTP_SCHEME']) ? $_SERVER['HTTP_SCHEME'] : ((isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS'] != 'off')) ? 'https' : 'http'); if (isset($_SERVER['HTTP_HOST'])) {