]> git.openstreetmap.org Git - nominatim.git/commitdiff
more restrictive parsing of lat/lon
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 25 Jun 2013 06:24:22 +0000 (08:24 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 25 Jun 2013 06:24:22 +0000 (08:24 +0200)
Require a decimal point in both numbers to avoid cases like
https://trac.openstreetmap.org/ticket/4884

website/search.php

index 9c8c8a6ed07a2a8f65398807236f920b838763ab..aa0e870adb5c4242015b16f39f2b8af5b6fc903e 100755 (executable)
                                $sQuery = trim(str_replace($aData[0], ' ', $sQuery));
                        }
                }
-               elseif (preg_match('/(\\[|^|\\b)(-?[0-9]+[0-9.]*)[, ]+(-?[0-9]+[0-9.]*)(\\]|$|\\b)/', $sQuery, $aData))
+               elseif (preg_match('/(\\[|^|\\b)(-?[0-9]+[0-9]*\\.[0-9]+)[, ]+(-?[0-9]+[0-9]*\\.[0-9]+)(\\]|$|\\b)/', $sQuery, $aData))
                {
                        $fQueryLat = $aData[2];
                        $fQueryLon = $aData[3];