// Preferred language
$aLangPrefOrder = getPreferredLanguages();
+ $bReverseInPlan = true;
+ /*
if (isset($aLangPrefOrder['name:de'])) $bReverseInPlan = true;
if (isset($aLangPrefOrder['name:ru'])) $bReverseInPlan = true;
if (isset($aLangPrefOrder['name:ja'])) $bReverseInPlan = true;
if (isset($aLangPrefOrder['name:pl'])) $bReverseInPlan = true;
+ */
$sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$aLangPrefOrder))."]";
$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];
$aValidTokens[$sToken] = $aGBPostcodeLocation;
}
}
+ // US ZIP+4 codes - if there is no token,
+ // merge in the 5-digit ZIP code
+ else if (!isset($aValidTokens[$sToken]) && preg_match('/^([0-9]{5}) [0-9]{4}$/', $sToken, $aData))
+ {
+ if (isset($aValidTokens[$aData[1]]))
+ {
+ foreach($aValidTokens[$aData[1]] as $aToken)
+ {
+ if (!$aToken['class'])
+ {
+ if (isset($aValidTokens[$sToken]))
+ {
+ $aValidTokens[$sToken][] = $aToken;
+ }
+ else
+ {
+ $aValidTokens[$sToken] = array($aToken);
+ }
+ }
+ }
+ }
+ }
}
foreach($aTokens as $sToken)