{"action":"created","issue":{"url":"https://api.github.com/repos/antonioribeiro/firewall/issues/45","repository_url":"https://api.github.com/repos/antonioribeiro/firewall","labels_url":"https://api.github.com/repos/antonioribeiro/firewall/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/antonioribeiro/firewall/issues/45/comments","events_url":"https://api.github.com/repos/antonioribeiro/firewall/issues/45/events","html_url":"https://github.com/antonioribeiro/firewall/issues/45","id":137924463,"number":45,"title":"IP blacklisting broken (commit 0c901ed)","user":{"login":"meed-luta","id":16080998,"avatar_url":"https://avatars.githubusercontent.com/u/16080998?v=3","gravatar_id":"","url":"https://api.github.com/users/meed-luta","html_url":"https://github.com/meed-luta","followers_url":"https://api.github.com/users/meed-luta/followers","following_url":"https://api.github.com/users/meed-luta/following{/other_user}","gists_url":"https://api.github.com/users/meed-luta/gists{/gist_id}","starred_url":"https://api.github.com/users/meed-luta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meed-luta/subscriptions","organizations_url":"https://api.github.com/users/meed-luta/orgs","repos_url":"https://api.github.com/users/meed-luta/repos","events_url":"https://api.github.com/users/meed-luta/events{/privacy}","received_events_url":"https://api.github.com/users/meed-luta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-02T16:33:29Z","updated_at":"2016-03-03T12:52:05Z","closed_at":null,"body":"Hello,\r\n\r\nin our environment the IP blacklisting is not working.\r\nWe think we spotted the error, it's in the Firewall::isBlacklisted() method:\r\n\r\n```\r\n    /**\r\n     * Check if IP is blacklisted.\r\n     *\r\n     * @param null $ip\r\n     * @return bool\r\n     */\r\n    public function isBlacklisted($ip = null) {\r\n        $list = $this->whichList($ip);\r\n        return !$list == 'whitelist' &&\r\n        $list == 'blacklist';\r\n    }\r\n\r\n```\r\nThe boolean expression at the end returns FALSE for IP's which are blacklisted \r\nbut not whitelisted.\r\n\r\nThe problem is caused by missing parentheses around the first comparison.\r\nCorrect would be:\r\n\r\n```\r\nreturn !($list == 'whitelist') &&\r\n\t   $list == 'blacklist';\r\n```\r\n\r\nBest regards,\r\nAnke\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/antonioribeiro/firewall/issues/comments/191750414","html_url":"https://github.com/antonioribeiro/firewall/issues/45#issuecomment-191750414","issue_url":"https://api.github.com/repos/antonioribeiro/firewall/issues/45","id":191750414,"user":{"login":"meed-luta","id":16080998,"avatar_url":"https://avatars.githubusercontent.com/u/16080998?v=3","gravatar_id":"","url":"https://api.github.com/users/meed-luta","html_url":"https://github.com/meed-luta","followers_url":"https://api.github.com/users/meed-luta/followers","following_url":"https://api.github.com/users/meed-luta/following{/other_user}","gists_url":"https://api.github.com/users/meed-luta/gists{/gist_id}","starred_url":"https://api.github.com/users/meed-luta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meed-luta/subscriptions","organizations_url":"https://api.github.com/users/meed-luta/orgs","repos_url":"https://api.github.com/users/meed-luta/repos","events_url":"https://api.github.com/users/meed-luta/events{/privacy}","received_events_url":"https://api.github.com/users/meed-luta/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T12:52:05Z","updated_at":"2016-03-03T12:52:05Z","body":"Version 0.5.3 is still working in our environment. The error seems to be in version 0.5.4 and 1.0.0."}}