rules = explode("\n", @file_get_contents($file)); } } /** * Check the URL against the blacklist rules * * @param string $url * @return boolean is blacklisted or not? */ function isBlacklisted($url) { foreach ($this->rules as $rule) { if (! empty($rule) && preg_match($rule, $url)) { return true; } } return false; } }