]> git.openstreetmap.org Git - nominatim.git/commitdiff
blacklist broken request from faulty app
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 26 Mar 2021 08:32:50 +0000 (09:32 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 26 Mar 2021 08:32:50 +0000 (09:32 +0100)
This filters out the query '-1,-1' which is being sent by some
faulty app and just takes too long to process.

lib-php/website/search.php

index 619dec6d9b67aaf8f911737595f5686526741fa4..4dcbc5b7b84b062354da6e8fca59745103a3c059 100644 (file)
@@ -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));