[TYPO3-core] RFC: Bug 4476: Allow limitation of config.linkVars

Dmitry Dulepov dmitry at typo3.org
Wed Jan 24 15:05:42 CET 2007


Hi!

Michael Stucki wrote:
> This is a SVN patch request.
> 
> Problem:
> Say you have a multilanguage website and use the &L parameter to differ 
> between languages. Now you may only have two languages (L=0, L=1) but 
> config.linkVars allows just any variable to be copied this way.
> 
> The bad thing is, that this page may be stored in the page cache if there is 
> no entry yet. And it's even worse to use it in combination with plugins 
> (&cHash) and &no_cache=1....
> 
> Solution:
> Allow to specify which values are allowed for config.linkVars

Let's rename isAllowedLinkVar to isAllowedLinkVarValue because it checks 
value, not variable [name].

Second, if regular expression contains comma, logic breaks :( Not sure 
how to fix it better.

Third, range check for numbers does not work (wrong comparison there), 
should be:
	if ($range[0] <= $haystack && $range[1] >= $haystack)
while now it is:
	if ($range[0] >= $haystack && $range[1] <= $haystack)

Forth, it is impossible to use comma inside regular expression (as I 
wrote above) and modifiers after it (i.e. /[a-z]/ will work but /[a-z/i 
will not). Modifiers can be fixed with:
	preg_match('/^\/.+\/[imsxeADSUXu]*$/', $needle)

Fifth, I am not sure if list should allow spaces between items, i.e. 
(aaa | bbb | ccc), but I like spaces :) So I did comparison with regular 
expression.

Otherwise all ok. I attach changes here as updated patch.

Sometimes I hate myself for being too pedantic :(

-- 
Dmitry Dulepov

Web: http://typo3bloke.net/
Skype: callto:liels_bugs

"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: linkVars_2.txt
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070124/a9e3ed4b/attachment-0001.txt 


More information about the TYPO3-team-core mailing list