From 96c7ea5424f92c99017233d766c21c9737f4239e Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sun, 26 Dec 2010 21:48:02 +0100 Subject: [PATCH] Do not search for pseudo country if text only contains one line. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/gmapsgeocoder.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; + } } } -- 2.1.4