[BUGFIX] Wrong check for existance of translated label
authorSteffen Gebert <steffen.gebert@typo3.org>
Sun, 17 Jul 2011 11:46:25 +0000 (13:46 +0200)
committerSteffen Gebert <steffen.gebert@typo3.org>
Wed, 20 Jul 2011 11:39:05 +0000 (13:39 +0200)
While tslib_fe::getLL() checks the existance of a translated label with
isset(), language::getLLL() does this with a strict string comparison.
This is evaluated as TRUE, if the subkey is not set at all, which is an
unexpected behavior.

Thus check, whether the label was translated into the current language
using isset().

Change-Id: I421d541d9aeaa2403052d212c7adba819a4e116f
Resolves: #28264
Releases: 4.6
Reviewed-on: http://review.typo3.org/3380
Reviewed-by: Xavier Perseguers
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Steffen Gebert
Tested-by: Steffen Gebert
typo3/sysext/lang/lang.php

index 36f196e..214f1e6 100755 (executable)
@@ -291,7 +291,7 @@ class language {
         */
        public function getLL($index, $hsc = FALSE) {
                        // Get Local Language
-               if ($GLOBALS['LOCAL_LANG'][$this->lang][$index][0]['target'] !== '') {
+               if (isset($GLOBALS['LOCAL_LANG'][$this->lang][$index][0]['target'])) {
                        $output = $GLOBALS['LOCAL_LANG'][$this->lang][$index][0]['target'];
                } else {
                        $output = $GLOBALS['LOCAL_LANG']['default'][$index][0]['target'];