Index: typo3/sysext/cms/tslib/class.tslib_pagegen.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_pagegen.php (revision 7262) +++ typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy) @@ -180,43 +180,45 @@ } // linkVars - $linkVars = (string)$GLOBALS['TSFE']->config['config']['linkVars']; - if ($linkVars) { - $linkVarArr = explode(',',$linkVars); - - $GLOBALS['TSFE']->linkVars=''; - $GET = t3lib_div::_GET(); - - foreach ($linkVarArr as $val) { - $val = trim($val); - - if (preg_match('/^(.*)\((.+)\)$/',$val,$match)) { - $val = trim($match[1]); + $linkVars = $GLOBALS['TSFE']->config['config']['linkVars']; + if ($linkVars) { + $linkVarArr = explode(',', $linkVars); + // Needed for usage of tslib_cObj::getGlobal + $GLOBALS['TSFE']->newCObj(); + foreach ($linkVarArr as $linkVar) { + $getValue = $GLOBALS['TSFE']->cObj->getGlobal($linkVar, t3lib_div::_GET()); + list($firstKey, $rest) = explode('|', $linkVar, 2); + if (strlen(trim($rest))) { + $linkVar = $firstKey . '[' . $rest . ']'; + } + + if (preg_match('/^(.*)\((.+)\)$/', $linkVar, $match)) { + $linkVar = trim($match[1]); $test = trim($match[2]); - } else unset($test); - - if ($val && isset($GET[$val])) { - if (!is_array($GET[$val])) { - $tmpVal = rawurlencode($GET[$val]); + } else { + unset($test); + } + + if ($linkVar && isset($getValue) && strlen($getValue) > 0) { + if (!is_array($getValue)) { + $getValue = rawurlencode($getValue); - if ($test && !TSpagegen::isAllowedLinkVarValue($tmpVal,$test)) { + if ($test && !self::isAllowedLinkVarValue($getValue, $test)) { continue; // Error: This value was not allowed for this key } - - $value = '&'.$val.'='.$tmpVal; + + $value = '&' . $linkVar . '=' . $getValue; } else { - if ($test && strcmp('array',$test)) { + if ($test && strcmp('array', $test)) { continue; // Error: This key must not be an array! } - $value = t3lib_div::implodeArrayForUrl($val,$GET[$val]); + $value = t3lib_div::implodeArrayForUrl($linkVar, $getValue); } - } else continue; - - $GLOBALS['TSFE']->linkVars.= $value; + $GLOBALS['TSFE']->linkVars .= $value; + } } - unset($GET); } else { - $GLOBALS['TSFE']->linkVars=''; + $GLOBALS['TSFE']->linkVars = ''; } // Setting XHTML-doctype from doctype