Commit 6287624f authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix safe_require to work with suhoshin (freebsd) realpath (bug #667051)


Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent e61ddaa4
......@@ -1079,13 +1079,15 @@ function safe_require($plugintype, $pluginname, $filename='lib.php', $function='
$fullpath = get_config('docroot') . $plugintype . '/' . $pluginname . '/' . $filename;
}
if (!$realpath = realpath($fullpath)) {
if (!file_exists($fullpath)) {
if (!empty($nonfatal)) {
return false;
}
throw new SystemException ("File $fullpath did not exist");
}
$realpath = realpath($fullpath);
if (strpos($realpath, get_config('docroot') !== 0)) {
if (!empty($nonfatal)) {
return false;
......
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