We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edd1c67 commit 8930e2eCopy full SHA for 8930e2e
src/Middleware/BlockBots.php
@@ -97,12 +97,24 @@ private function isAllowedBot()
97
return preg_match($pattern, $userAgent);
98
}
99
100
+ /**
101
+ * @return mixed|string|null
102
+ */
103
+ public function getMatchedBot()
104
+ {
105
+ foreach (array_keys($this->getAllowedBots()) as $bot) {
106
+ if (strpos(strtolower($this->client->userAgent), strtolower($bot)) !== false) {
107
+ return $bot;
108
+ }
109
110
111
+
112
/**
113
* Check if the client is whitelisted.
114
*
115
* @return bool
116
*/
- private function isWhitelisted()
117
+ public function isWhitelisted()
118
{
119
if (Redis::sismember($this->options->whitelist_key, $this->client->ip)) {
120
return true;
0 commit comments