1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Issue #1975 Banlist failing when action file not found.

This commit is contained in:
Cameron
2016-11-02 11:39:19 -07:00
parent 7701a5ac1b
commit 5ea369a634

View File

@@ -372,7 +372,7 @@ class eIPHandler
* *
* @param int $code - integer value < 0 specifying the ban reason. * @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. * 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. * 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.']'; $search = '['.$code.']';
$fileName = $this->ourConfigDir.eIPHandler::BAN_FILE_ACTION_NAME.eIPHandler::BAN_FILE_EXTENSION; $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); $vals = file($fileName);
if ($vals === FALSE || count($vals) == 0) return; if ($vals === FALSE || count($vals) == 0) return;