From: Nicolas Iooss Date: Sun, 5 Oct 2014 14:46:52 +0000 (+0200) Subject: Fix possible out-of-bound array access in GMapsGeocoder::getTextToGeocode X-Git-Url: http://git.polytechnique.org/?p=platal.git;a=commitdiff_plain;h=d745ff21fe38e6b35450ce6eb6a5e774ffd0f54c Fix possible out-of-bound array access in GMapsGeocoder::getTextToGeocode --- diff --git a/classes/gmapsgeocoder.php b/classes/gmapsgeocoder.php index c16ebba..e009080 100644 --- a/classes/gmapsgeocoder.php +++ b/classes/gmapsgeocoder.php @@ -241,6 +241,9 @@ class GMapsGeocoder extends Geocoder { } $textLines = explode("\n", $text); $countLines = count($textLines); + if ($countLines < 2) { + return $text; + } $needle = strtoupper(trim($textLines[$countLines - 2])); $isPseudoCountry = false; if ($needle) {