[BUGFIX] "fixed_lgd_cs" may crash in eID environment 98/40498/2
authorBenjamin Mack <benni@typo3.org>
Sat, 20 Jun 2015 18:14:04 +0000 (20:14 +0200)
committerBenjamin Mack <benni@typo3.org>
Mon, 22 Jun 2015 10:29:22 +0000 (12:29 +0200)
Under certain circumstances during an eID call,
calling fixed_lgd_cs() could lead to a fatal error due
to a "half-initialized" TSFE object.

See https://forge.typo3.org/issues/24858

Resolves: #24858
Releases: master, 6.2
Change-Id: Ic064c5963d07bc57897eb53773673d09e85717c1
Reviewed-on: http://review.typo3.org/40498
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Tested-by: Frederic Gaus <frederic.gaus@flagbit.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index fdd742b..f24df41 100755 (executable)
@@ -329,7 +329,7 @@ class GeneralUtility {
        static public function fixed_lgd_cs($string, $chars, $appendString = '...') {
                if (is_object($GLOBALS['LANG'])) {
                        return $GLOBALS['LANG']->csConvObj->crop($GLOBALS['LANG']->charSet, $string, $chars, $appendString);
-               } elseif (is_object($GLOBALS['TSFE'])) {
+               } elseif (is_object($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE']->csConvObj)) {
                        $charSet = $GLOBALS['TSFE']->renderCharset != '' ? $GLOBALS['TSFE']->renderCharset : $GLOBALS['TSFE']->defaultCharSet;
                        return $GLOBALS['TSFE']->csConvObj->crop($charSet, $string, $chars, $appendString);
                } else {