diff options
Diffstat (limited to 'web/include/thebrain.php')
-rw-r--r-- | web/include/thebrain.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/web/include/thebrain.php b/web/include/thebrain.php index eb36a73..0baf3d0 100644 --- a/web/include/thebrain.php +++ b/web/include/thebrain.php @@ -6,12 +6,14 @@ $navlist = array( ); function include_safe($file) { - if (strpos(realpath("include/$file"), realpath($_SERVER['DOCUMENT_ROOT'])) !== 0) { - $code = 403; - require("errors.php"); - } - elseif (file_exists("include/$file")) { - include($file); + if (file_exists("include/$file")) { + if (strpos(realpath("include/$file"), realpath($_SERVER['DOCUMENT_ROOT'])) !== 0) { + $code = 403; + require("errors.php"); + } + else { + include($file); + } } else { $code = 404; @@ -24,5 +26,5 @@ if (!$_GET['page']) { } else { $page = $_GET['page']; - +} ?> |