From: Sarah Hoffmann Date: Fri, 26 Mar 2021 08:32:50 +0000 (+0100) Subject: blacklist broken request from faulty app X-Git-Tag: deploy~169 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/d535dbf337f89d4f8c9ae4124de3c3a08cb0df89 blacklist broken request from faulty app This filters out the query '-1,-1' which is being sent by some faulty app and just takes too long to process. --- diff --git a/lib-php/website/search.php b/lib-php/website/search.php index 619dec6d..4dcbc5b7 100644 --- a/lib-php/website/search.php +++ b/lib-php/website/search.php @@ -54,7 +54,12 @@ if (!$oGeocode->getQueryString() $hLog = logStart($oDB, 'search', $oGeocode->getQueryString(), $aLangPrefOrder); -$aSearchResults = $oGeocode->lookup(); +// Ignore requests from a faulty app. +if ($oGeocode->getQueryString() === '-1,-1') { + $aSearchResults = array(); +} else { + $aSearchResults = $oGeocode->lookup(); +} logEnd($oDB, $hLog, count($aSearchResults));