X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/320d488627b1a5674458cbef644c6731882b2a23..e4a51e460e0e7020fed0eeeb8b6cce7148e0bb58:/website/details.php diff --git a/website/details.php b/website/details.php index 2427c9dd..81d643f0 100755 --- a/website/details.php +++ b/website/details.php @@ -5,11 +5,13 @@ require_once(dirname(dirname(__FILE__)).'/settings/settings.php'); require_once(CONST_BasePath.'/lib/init-website.php'); require_once(CONST_BasePath.'/lib/log.php'); require_once(CONST_BasePath.'/lib/output.php'); +require_once(CONST_BasePath.'/lib/AddressDetails.php'); ini_set('memory_limit', '200M'); $oParams = new Nominatim\ParameterParser(); $sOutputFormat = $oParams->getSet('format', array('html', 'json'), 'html'); +set_exception_handler_by_format($sOutputFormat); $aLangPrefOrder = $oParams->getPreferredLanguages(); $sLanguagePrefArraySQL = 'ARRAY['.join(',', array_map('getDBQuoted', $aLangPrefOrder)).']'; @@ -164,14 +166,8 @@ if (PEAR::isError($aPointDetails['aExtraTags'])) { // possible timeout // Address $aAddressLines = false; if ($bIncludeAddressDetails) { - $aAddressLines = getAddressDetails( - $oDB, - $sLanguagePrefArraySQL, - $iPlaceID, - $aPointDetails['country_code'], - -1, - true - ); + $oDetails = new Nominatim\AddressDetails($oDB, $iPlaceID, -1, $sLanguagePrefArraySQL); + $aAddressLines = $oDetails->getAddressDetails(true); } // Linked places