From: Stéphane Jacob Date: Sun, 26 Dec 2010 20:48:02 +0000 (+0100) Subject: Do not search for pseudo country if text only contains one line. X-Git-Tag: xorg/1.0.2~57 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=96c7ea5424f92c99017233d766c21c9737f4239e;p=platal.git Do not search for pseudo country if text only contains one line. Signed-off-by: Stéphane Jacob --- diff --git a/classes/gmapsgeocoder.php b/classes/gmapsgeocoder.php index d8fad1f..f6a3dc1 100644 --- a/classes/gmapsgeocoder.php +++ b/classes/gmapsgeocoder.php @@ -334,10 +334,12 @@ class GMapsGeocoder extends Geocoder { $countLines = count($textLines); $needle = strtoupper(trim($textLines[$countLines - 2])); $isPseudoCountry = false; - foreach ($countries as $country) { - if (strtoupper($country) == $needle) { - $isPseudoCountry = true; - break; + if ($needle) { + foreach ($countries as $country) { + if (strtoupper($country) === $needle) { + $isPseudoCountry = true; + break; + } } }