]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix adding of spaces in GB postcode
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 21 Sep 2014 20:44:06 +0000 (22:44 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 21 Sep 2014 20:44:06 +0000 (22:44 +0200)
Based on https://github.com/twain47/Nominatim/pull/180 by arunkmp.

lib/Geocode.php

index 0b3bd51f1f72c87bb6b26be336b5d467d2c9d89a..c8cc4c4a6621b02838fa19caee61075383d434f7 100644 (file)
                                                {
                                                        if (substr($aData[1],-2,1) != ' ')
                                                        {
-                                                               $aData[0] = substr($aData[0],0,strlen($aData[1]-1)).' '.substr($aData[0],strlen($aData[1]-1));
+                                                               $aData[0] = substr($aData[0],0,strlen($aData[1])-1).' '.substr($aData[0],strlen($aData[1])-1);
                                                                $aData[1] = substr($aData[1],0,-1).' '.substr($aData[1],-1,1);
                                                        }
                                                        $aGBPostcodeLocation = gbPostcodeCalculate($aData[0], $aData[1], $aData[2], $this->oDB);