Index: typo3/sysext/cms/tslib/class.tslib_content.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_content.php (revision 7247)
+++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
@@ -5716,30 +5716,28 @@
* @access private
* @see getData()
*/
- function getGlobal($var, $source=NULL) {
- $vars = explode('|', $var);
- $c = count($vars);
- $k = trim($vars[0]);
- $theVar = isset($source) ? $source[$k] : $GLOBALS[$k];
+ function getGlobal($keyString, $source = NULL) {
+ $keys = explode('|', $keyString);
+ $numberOfLevels = count($keys);
+ $rootKey = trim($keys[0]);
+ $value = isset($source) ? $source[$rootKey] : $GLOBALS[$rootKey];
- for ($a=1;$a<$c;$a++) {
- if (!isset($theVar)) { break; }
-
- $key = trim($vars[$a]);
- if (is_object($theVar)) {
- $theVar = $theVar->$key;
- } elseif (is_array($theVar)) {
- $theVar = $theVar[$key];
+ for ($i = 1; $i < $numberOfLevels && isset($value); $i++) {
+ $currentKey = trim($keys[$i]);
+ if (is_object($value)) {
+ $value = $value->$currentKey;
+ } elseif (is_array($value)) {
+ $value = $value[$currentKey];
} else {
- return '';
+ $value = '';
+ break;
}
}
- if (!is_array($theVar) && !is_object($theVar)) {
- return $theVar;
- } else {
- return '';
+ if (!is_scalar($value)) {
+ $value = '';
}
+ return $value;
}
/**
@@ -6989,7 +6987,7 @@
/*]]>*/
';
- $GLOBALS['TSFE']->additionalHeaderData['JSincludeFormupdate']='';
+ $GLOBALS['TSFE']->additionalHeaderData['JSincludeFormupdate']='';
return $JSPart;
}