narrowed w3w mapsearch regex; updates #710

This commit is contained in:
following 2015-05-25 14:30:09 +02:00
parent 40511db4ab
commit 0a02baaae3

View File

@ -398,7 +398,7 @@ function output_namesearch($sName, $nLat, $nLon, $nResultId)
} }
sql_free_result($rs); sql_free_result($rs);
if (!$caches_found && preg_match('/^[^\s]{2,}\.[^\s]{2,}\.[^\s]{2,}$/', $sName)) if (!$caches_found && preg_match('/^[^\s[:punct:]]{2,}\.[^\s[:punct:]]{2,}\.[^\s[:punct:]]{2,}$/', $sName))
{ {
$result = @file_get_contents('http://api.what3words.com/w3w?key=' . $opt['lib']['w3w']['apikey'] $result = @file_get_contents('http://api.what3words.com/w3w?key=' . $opt['lib']['w3w']['apikey']
. '&string=' . urlencode($sName)); . '&string=' . urlencode($sName));