]> 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>
Sun, 7 Jul 2013 14:44:37 +0000 (16:44 +0200)
Require a decimal point in both numbers to avoid cases like
https://trac.openstreetmap.org/ticket/4884

website/search.php

index 18fcbafcc370657d86e499816df147750ae37967..272324b19e6853a533928853fa6f40e76aae2652 100755 (executable)
                                $sQuery = trim(str_replace($aData[0], ' ', $sQuery));
                        }
                }
                                $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];
                {
                        $fQueryLat = $aData[2];
                        $fQueryLon = $aData[3];