changeset 33:3bb56a94c4f5

Adjust the bot/crawler check.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 21 Aug 2019 15:37:36 +0300
parents 0a1d61be7811
children 734497aeffa4
files index.php
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/index.php	Thu Mar 29 12:18:40 2018 +0300
+++ b/index.php	Wed Aug 21 15:37:36 2019 +0300
@@ -141,8 +141,8 @@
 $sortDirs = [ "asc", "desc" ];
 
 // Horrible kludge
-$agent = $_SERVER["HTTP_USER_AGENT"];
-if (stristr($agent, "GoogleBot") !== FALSE)
+$agent = isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : FALSE;
+if ($agent === FALSE || stristr($agent, "bot") !== FALSE)
 {
   header("HTTP/1.1 403 Forbidden");
   exit;