Project

General

Profile

Feature #17238 ยป 5489.patch

Administrator Admin, 2007-04-24 23:52

View differences:

class.tslib_pagegen.php 2007-04-24 23:26:18.000000000 +0200
$linkVars = (string)$GLOBALS['TSFE']->config['config']['linkVars'];
if ($linkVars) {
$linkVarArr = explode(',',$linkVars);
$linkVars = '';
$GLOBALS['TSFE']->linkVars='';
$GET = t3lib_div::_GET();
foreach ($linkVarArr as $val) {
......
if (preg_match('/^(.*)\((.+)\)$/',$val,$match)) {
$val = trim($match[1]);
$test = trim($match[2]);
$testArr = t3lib_div::trimExplode('|',$match[2],1);
} else unset($test);
if ($val && isset($GET[$val])) {
$continue = true;
if (!is_array($GET[$val])) {
$tmpVal = rawurlencode($GET[$val]);
if ($test && !TSpagegen::isAllowedLinkVarValue($tmpVal,$test)) {
continue; // Error: This value was not allowed for this key
if ($val=='cHash') {
// Reusing cHash will not work - if set, remove it here and recreate it later if necessary.
if (isset($tmpVal)) {
$createCHash = true;
}
continue;
} elseif (count($testArr)) {
foreach ($testArr as $test) {
if (TSpagegen::isAllowedLinkVarValue($tmpVal,$test)) {
$continue = false;
break;
}
}
if ($continue) {
continue; // Error: This value was not allowed for this key
}
}
$value = '&'.$val.'='.$tmpVal;
} else {
if ($test && strcmp('array',$test)) {
continue; // Error: This key must not be an array!
if (count($testArr)) {
if (!strcmp('array',$testArr[0])) {
$GET_array = $GET[$val];
$continue = false;
} else {
$GET_array = array();
foreach ($testArr as $test) {
if (array_key_exists($test,$GET[$val])) {
$continue = false;
$GET_array[$test] = $GET[$val][$test];
}
}
}
if ($continue) {
continue; // Error: This key is not allowed as array generally or the key is not registered
}
} else {
$GET_array = $GET[$val];
}
$value = t3lib_div::implodeArrayForUrl($val,$GET[$val]);
$value = t3lib_div::implodeArrayForUrl($val,$GET_array);
}
} else continue;
$GLOBALS['TSFE']->linkVars.= $value;
// Read the current variable to the linkVars:
$linkVars .= $value;
}
unset($GET);
// Recreate cHash if necessary:
if ($linkVars && $createCHash) {
// get the array with query params, one key is the encryptionKey by default:
$pA = t3lib_div::cHashParams($linkVars);
if (count($pA) > 1) {
$linkVars .= '&cHash='.t3lib_div::shortMD5(serialize($pA));
}
}
$GLOBALS['TSFE']->linkVars = $linkVars;
} else {
$GLOBALS['TSFE']->linkVars='';
$GLOBALS['TSFE']->linkVars = '';
}
// Setting XHTML-doctype from doctype
......
}
}
} elseif (strstr($needle,'|')) { // List
$haystack = str_replace(' ','',$haystack); // Trim the input
if (strstr('|'.$needle.'|', '|'.$haystack.'|')) {
$OK = true;
}
} elseif (!strcmp($needle,$haystack)) { // String comparison
$OK = true;
}
    (1-1/1)