From 32ea610559f497bb5f1fcdeb5c08ba1a64b35a57 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 29 Sep 2019 10:23:36 +0000 Subject: [PATCH] Avoid a contact lookup for empty URL --- src/Module/Magic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Module/Magic.php b/src/Module/Magic.php index 4510d8d934..7cbc4794b3 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -32,15 +32,16 @@ class Magic extends BaseModule $dest = defaults($_REQUEST, 'dest', ''); $test = (!empty($_REQUEST['test']) ? intval($_REQUEST['test']) : 0); $owa = (!empty($_REQUEST['owa']) ? intval($_REQUEST['owa']) : 0); + $cid = 0; if (!empty($addr)) { $cid = Contact::getIdForURL($addr); - } else { + } elseif (!empty($dest)) { $cid = Contact::getIdForURL($dest); } if (!$cid) { - Logger::log('No contact record found: ' . json_encode($_REQUEST), Logger::DEBUG); + Logger::info('No contact record found', $_REQUEST); // @TODO Finding a more elegant possibility to redirect to either internal or external URL $a->redirect($dest); } -- 2.39.5