From 9549bda474c704dc763856924a03e28cd255419c Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Mon, 9 Jul 2012 18:16:54 +0200 Subject: [PATCH] Fix wrong variable used with PEAR::IsError() Fixes: PHP Fatal error: Cannot use object of type DB_Error as array in /home/daniele/Programmazione/OSM/Nominatim/website/reverse.php on line 104 --- website/reverse.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/reverse.php b/website/reverse.php index 4cd95016..70779dd7 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -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 -- 2.39.5