Commit 3a403c4b authored by Nigel McNie's avatar Nigel McNie Committed by Richard Mansfield
Browse files

Throw SystemExceptions rather than Exceptions when files can't be found to be...

Throw SystemExceptions rather than Exceptions when files can't be found to be included in safe_require.
parent 375ea4cd
......@@ -905,14 +905,14 @@ function safe_require($plugintype, $pluginname, $filename='lib.php', $function='
if (!empty($nonfatal)) {
return false;
}
throw new Exception ("File $fullpath did not exist");
throw new SystemException ("File $fullpath did not exist");
}
if (strpos($realpath, get_config('docroot') !== 0)) {
if (!empty($nonfatal)) {
return false;
}
throw new Exception ("File $fullpath was outside document root!");
throw new SystemException ("File $fullpath was outside document root!");
}
if ($function == 'require') { return require($realpath); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment