[BUGFIX] PHP warning when no language pack is available
authorXavier Perseguers <xavier@typo3.org>
Fri, 24 Aug 2012 08:51:07 +0000 (10:51 +0200)
committerXavier Perseguers <xavier@typo3.org>
Fri, 24 Aug 2012 08:57:55 +0000 (10:57 +0200)
Make sure to return either an array or a boolean and not a
string when retrieving the status of an translation pack.

Change-Id: Ic837026f387e370cf28a5c65866954898dc8a37c
Fixes: #40108
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/14025
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/em/classes/connection/class.tx_em_connection_ter.php

index 0431b23..bf1d2ab 100644 (file)
@@ -140,7 +140,7 @@ class tx_em_Connection_Ter {
 
                if ($remote !== FALSE) {
                        $parsed = $this->emObj->xmlHandler->parseL10nXML($remote);
-                       return $parsed['languagePackIndex'];
+                       return is_array($parsed['languagePackIndex']) ? $parsed['languagePackIndex'] : FALSE;
                }
 
                return FALSE;