diff --git a/framework/helper.class.php b/framework/helper.class.php index fd5faa3ce7..5a27b026a7 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -545,7 +545,8 @@ function getWebRoot() if(defined('IN_SHELL')) { $url = parse_url($_SERVER['argv'][1]); - $path = $url['path']; + $path = empty($url['path']) ? '/' : rtrim($url['path'], '/'); + $path = empty($path) ? '/' : $path; } return substr($path, 0, (strrpos($path, '/') + 1)); }