X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/419f90ed75e91ddb06d4809bc07a580fe08874a3..df3202017e681dc6973c66d8fc779604c6d29e3f:/website/reverse.php?ds=inline diff --git a/website/reverse.php b/website/reverse.php index 4cd95016..c155fa57 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -28,8 +28,8 @@ $bShowAddressDetails = true; if (isset($_GET['addressdetails'])) $bShowAddressDetails = (bool)$_GET['addressdetails']; - // Prefered language - $aLangPrefOrder = getPrefferedLangauges(); + // Preferred language + $aLangPrefOrder = getPreferredLanguages(); $sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$aLangPrefOrder))."]"; $hLog = logStart($oDB, 'reverse', $_SERVER['QUERY_STRING'], $aLangPrefOrder); @@ -101,12 +101,12 @@ $sSQL .= ' ORDER BY ST_distance('.$sPointSQL.', geometry) ASC limit 1'; //var_dump($sSQL); $aPlace = $oDB->getRow($sSQL); - $iPlaceID = $aPlace['place_id']; - $iParentPlaceID = $aPlace['parent_place_id']; - if (PEAR::IsError($iPlaceID)) + if (PEAR::IsError($aPlace)) { failInternalError("Could not determine closest place.", $sSQL, $iPlaceID); } + $iPlaceID = $aPlace['place_id']; + $iParentPlaceID = $aPlace['parent_place_id']; } // The point we found might be too small - use the address to find what it is a child of