Skip to content
Snippets Groups Projects
Commit 472b1e65 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #421 from greezybacon/issue/420


Ensure a ROOT_PATH is defined for CLI apps

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents e6ff3b47 2bf468f0
No related branches found
No related tags found
No related merge requests found
......@@ -397,7 +397,10 @@ class osTicket {
$file = str_replace('\\','/', $frame['file']);
$path = substr($file, strlen(ROOT_DIR));
if($path && ($pos=strpos($_SERVER['SCRIPT_NAME'], $path))!==false)
return substr($_SERVER['SCRIPT_NAME'], 0, $pos);
return ($pos) ? substr($_SERVER['SCRIPT_NAME'], 0, $pos) : '/';
if (self::is_cli())
return '/';
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment