From 58c5ec6b45dcc52107f5e7c8bbca2933c7f2e98d Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 16 Sep 2021 09:48:10 +0200 Subject: [PATCH] login: return success status to whatsapp crawler An 403 forbidden error will prevent metadata parsing and consecutive link preview. --- login/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.30.0