0005010_2.patch

Administrator Admin, 2007-02-17 14:47

Download (4.72 KB)

View differences:

t3lib/class.t3lib_tstemplate.php (Arbeitskopie)
1374 1374
		$LD['no_cache'] = (trim($page['no_cache']) || $no_cache) ? '&no_cache=1' : '';
1375 1375

  
1376 1376
			// linkVars
1377
		$LD['linkVars'] = $GLOBALS['TSFE']->linkVars.$addParams;			
1377 1378
		if ($GLOBALS['TSFE']->config['config']['uniqueLinkVars']) {
1378
			if ($addParams) {
1379
				$LD['linkVars'] = t3lib_div::implodeArrayForUrl('',t3lib_div::explodeUrl2Array($GLOBALS['TSFE']->linkVars.$addParams));
1380
			} else {
1381
				$LD['linkVars'] = $GLOBALS['TSFE']->linkVars;
1382
			}
1383
		} else {
1384
			$LD['linkVars'] = $GLOBALS['TSFE']->linkVars.$addParams;
1379
			$LD['linkVars'] = t3lib_div::implodeArrayForUrl('',t3lib_div::explodeUrl2Array($LD['linkVars']));
1385 1380
		}
1386 1381

  
1387 1382
			// If simulateStaticDocuments is enabled:
typo3/sysext/cms/tslib/class.tslib_pagegen.php (Arbeitskopie)
197 197
		$linkVars = (string)$GLOBALS['TSFE']->config['config']['linkVars'];
198 198
		if ($linkVars)	{
199 199
			$linkVarArr = explode(',',$linkVars);
200
			$linkVars = '';
200 201

  
201
			$GLOBALS['TSFE']->linkVars='';
202 202
			$GET = t3lib_div::_GET();
203 203

  
204
			foreach ($linkVarArr as $val)	{
205
				$val = trim($val);
204
			foreach ($linkVarArr as $var)	{
205
				$var = trim($var);
206 206

  
207
				if (preg_match('/^(.*)\((.+)\)$/',$val,$match))	{
208
					$val = trim($match[1]);
207
				if (preg_match('/^(.*)\((.+)\)$/',$var,$match))	{
208
					$var = trim($match[1]);
209 209
					$test = trim($match[2]);
210 210
				} else unset($test);
211 211

  
212
				if ($val && isset($GET[$val]))	{
213
					if (!is_array($GET[$val]))	{
214
						$tmpVal = rawurlencode($GET[$val]);
212
				if ($var && isset($GET[$var]))	{
213
					if (!is_array($GET[$var]))	{
214
						$tmpVar = rawurlencode($GET[$var]);
215 215

  
216
						if ($test && !TSpagegen::isAllowedLinkVarValue($tmpVal,$test))	{
216
						if ($var=='cHash') {
217
								// Reusing cHash will not work - if set, remove it here and recreate it later if necessary.
218
							if (isset($tmpVar)) {
219
								$createCHash = true;
220
							}
221
							continue;
222
						} elseif ($test && !TSpagegen::isAllowedLinkVarValue($tmpVar,$test))	{
217 223
							continue;	// Error: This value was not allowed for this key
218 224
						}
219 225

  
220
						$value = '&'.$val.'='.$tmpVal;
226
						$value = '&'.$var.'='.$tmpVar;
221 227
					} else {
222 228
						if ($test && strcmp('array',$test))	{
223 229
							continue;	// Error: This key must not be an array!
224 230
						}
225
						$value = t3lib_div::implodeArrayForUrl($val,$GET[$val]);
231
						$value = t3lib_div::implodeArrayForUrl($var,$GET[$var]);
226 232
					}
227 233
				} else continue;
228 234

  
229
				$GLOBALS['TSFE']->linkVars.= $value;
235
					// Readd the current variable to the linkVars:
236
				$linkVars .= $value;
230 237
			}
231 238
			unset($GET);
239

  
240
				// Recreate cHash if necessary:
241
			if ($linkVars && $createCHash) {
242
					// Get the array with query params, one key is the encryptionKey by default:
243
				$pA = t3lib_div::cHashParams($linkVars);
244
				if (count($pA) > 1) {
245
					$linkVars .= '&cHash='.t3lib_div::shortMD5(serialize($pA));
246
				}
247
			}
248
			$GLOBALS['TSFE']->linkVars = $linkVars;
232 249
		} else {
233
			$GLOBALS['TSFE']->linkVars='';
250
			$GLOBALS['TSFE']->linkVars = '';
234 251
		}
235 252

  
236 253
			// Setting XHTML-doctype from doctype
typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie)
5199 5199
						if (substr($addQueryParams,0,1)!='&')		{
5200 5200
							$addQueryParams = '';
5201 5201
						} elseif ($conf['useCacheHash']) {	// cache hashing:
5202
							$pA = t3lib_div::cHashParams($addQueryParams.$GLOBALS['TSFE']->linkVars);	// Added '.$this->linkVars' dec 2003: The need for adding the linkVars is that they will be included in the link, but not the cHash. Thus the linkVars will always be the problem that prevents the cHash from working. I cannot see what negative implications in terms of incompatibilities this could bring, but for now I hope there are none. So here we go... (- kasper)
5202
							$pA = t3lib_div::cHashParams($GLOBALS['TSFE']->linkVars.$addQueryParams);	// Added '.$this->linkVars' dec 2003: The need for adding the linkVars is that they will be included in the link, but not the cHash. Thus the linkVars will always be the problem that prevents the cHash from working. I cannot see what negative implications in terms of incompatibilities this could bring, but for now I hope there are none. So here we go... (- kasper)
5203 5203
							$addQueryParams.= '&cHash='.t3lib_div::shortMD5(serialize($pA));
5204 5204
						}
5205 5205