From: Mischa POSLAWSKY Date: Thu, 16 Sep 2021 07:48:10 +0000 (+0200) Subject: login: return success status to whatsapp crawler X-Git-Tag: v5.4~22 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/58c5ec6b45dcc52107f5e7c8bbca2933c7f2e98d login: return success status to whatsapp crawler An 403 forbidden error will prevent metadata parsing and consecutive link preview. --- diff --git a/login/index.php b/login/index.php index 85dc2f5..cfe0027 100644 --- a/login/index.php +++ b/login/index.php @@ -39,7 +39,10 @@ elseif (isset($_GET['logout'])) { if (!$User or !$User->login) { $Page->title = 'Inloggen'; if (isset($_REQUEST['goto'])) { - if (empty($message)) http_response_code(403); + if (empty($message) + and !preg_match('(^WhatsApp/)', $_SERVER['HTTP_USER_AGENT'])) { + http_response_code(403); + } $target = ltrim($_REQUEST['goto'], '/'); $target = new ArchiveArticle("$target.html"); $target->index; # run forbidden handler to determine metadata