From 5ea369a6341789774bf750dec14b02aba49ede8c Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 2 Nov 2016 11:39:19 -0700 Subject: [PATCH] Issue #1975 Banlist failing when action file not found. --- e107_handlers/iphandler_class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/e107_handlers/iphandler_class.php b/e107_handlers/iphandler_class.php index 51603cc49..d42658e3d 100644 --- a/e107_handlers/iphandler_class.php +++ b/e107_handlers/iphandler_class.php @@ -372,7 +372,7 @@ class eIPHandler * * @param int $code - integer value < 0 specifying the ban reason. * - * @return none (may not even return) + * @return void (may not even return) * * Looks up the reason code, and extracts the corresponding text. * If this text begins with 'http://' or 'https://', assumed to be a link to a web page, and redirects. @@ -382,7 +382,17 @@ class eIPHandler { $search = '['.$code.']'; $fileName = $this->ourConfigDir.eIPHandler::BAN_FILE_ACTION_NAME.eIPHandler::BAN_FILE_EXTENSION; - if (!is_readable($fileName)) return; // @todo should we just die if no file - we know the IP is in the ban list. + + if(!is_readable($fileName)) // Note readable, but the IP is still banned, so half further script execution. + { + if($this->debug === true || e_DEBUG === true) + { + echo "Your IP is banned!"; + } + + die(); + // return; // + } $vals = file($fileName); if ($vals === FALSE || count($vals) == 0) return;