]> git.mxchange.org Git - friendica-addons.git/commitdiff
feat(blockbot): ensure good agent are whitelisted and add uptimerobot
authorvalvin <git@valvin.fr>
Sat, 18 Jan 2020 12:47:20 +0000 (13:47 +0100)
committervalvin <git@valvin.fr>
Sat, 18 Jan 2020 14:33:12 +0000 (15:33 +0100)
blockbot/blockbot.php

index 2714e494ecaad9c451a0f21a04245cfbf11ccdc2..5f6d0cb0269c34bfb18949601efd7c38fc89eabd 100644 (file)
@@ -55,7 +55,7 @@ function blockbot_init_1(App $a) {
 
        // List of "good" crawlers
        $good_agents = ['fediverse.space crawler', 'fediverse.network crawler', 'Active_Pods_CheckBot_3.0',
-                       'Social-Relay/', 'Test Certificate Info', 'Uptimebot/', 'GNUSocialBot'];
+                       'Social-Relay/', 'Test Certificate Info', 'Uptimebot/', 'GNUSocialBot', 'UptimeRobot/'];
 
        // List of known crawlers.
        $agents = ['SemrushBot', 's~feedly-nikon3', 'Qwantify/Bleriot/', 'ltx71', 'Sogou web spider/',
@@ -80,6 +80,13 @@ function blockbot_init_1(App $a) {
        if (!Config::get('blockbot', 'good_crawlers')) {
                $agents = array_merge($agents, $good_agents);
        }
+       else{
+               foreach($good_agents as $good_agent){
+                       if (stristr($_SERVER['HTTP_USER_AGENT'], $good_agent)) {
+                               return;
+                       }
+               }
+       }
 
        if (Config::get('blockbot', 'block_gab')) {
                $agents[] = 'GabSocial/';