]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/AddressDetails.php
add test for issue #1343
[nominatim.git] / lib / AddressDetails.php
index e6501b572d5b59b3632a0d61e14f711f5fa729c9..f52935863ce0c37d1a219fddb229d18efb1ff3a2 100644 (file)
@@ -26,7 +26,7 @@ class AddressDetails
         $sSQL .= ' FROM get_addressdata('.$iPlaceID.','.$sHousenumber.')';
         $sSQL .= ' ORDER BY rank_address DESC, isaddress DESC';
 
-        $this->aAddressLines = chksql($oDB->getAll($sSQL));
+        $this->aAddressLines = $oDB->getAll($sSQL);
     }
 
     private static function isAddress($aLine)
@@ -103,7 +103,7 @@ class AddressDetails
     public function getAdminLevels()
     {
         $aAddress = array();
-        foreach ($this->aAddressLines as $aLine) {
+        foreach (array_reverse($this->aAddressLines) as $aLine) {
             if (self::isAddress($aLine)
                 && isset($aLine['admin_level'])
                 && $aLine['admin_level'] < 15