]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge pull request #1321 from mtmail/interpolating-0-housenumbers
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 19 Apr 2019 16:29:43 +0000 (18:29 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Apr 2019 16:29:43 +0000 (18:29 +0200)
Support housenumber=0 in interpolations

1  2 
lib/AddressDetails.php

diff --combined lib/AddressDetails.php
index 2d40c84f4efc35e90421798cc14f35a35bde3f68,7b30d915843d413f0517eaa239467b98bd86e98a..b62335d1f61ace06277a7aebf23423dbba7ef3cc
@@@ -17,7 -17,7 +17,7 @@@ class AddressDetail
              $mLangPref = 'ARRAY['.join(',', array_map('getDBQuoted', $mLangPref)).']';
          }
  
-         if (!$sHousenumber) {
+         if (!isset($sHousenumber)) {
              $sHousenumber = -1;
          }
  
@@@ -31,7 -31,7 +31,7 @@@
  
      private static function isAddress($aLine)
      {
 -        return $aLine['isaddress'] == 't' || $aLine['type'] == 'country_code';
 +        return $aLine['isaddress'] || $aLine['type'] == 'country_code';
      }
  
      public function getAddressDetails($bAll = false)
@@@ -49,7 -49,7 +49,7 @@@
          $sPrevResult = '';
  
          foreach ($this->aAddressLines as $aLine) {
 -            if ($aLine['isaddress'] == 't' && $sPrevResult != $aLine['localname']) {
 +            if ($aLine['isaddress'] && $sPrevResult != $aLine['localname']) {
                  $sPrevResult = $aLine['localname'];
                  $aParts[] = $sPrevResult;
              }