[TYPO3-core] RFC Bug #11239: typolink: addQueryString.exclude does not support arrays

Christian Kuhn lolli at schwarzbu.ch
Sun Dec 27 23:22:23 CET 2009


This is a SVN patch request.

Type: Bugfix

Branches: 4.3, trunk

BT ref: http://bugs.typo3.org/view.php?id=11239

Problem:
getQueryArguments() in tslib_content has several issues:
- The method reacts differently if $conf['method'] is set or not. This 
is because t3lib_div::_GET / _POST returns multidimensional arrays, but 
the default QUERY_STRING is exploded to a one dimensional array instead. 
Thus $conf['exclude'] doesn't work if $conf['method'] is set.
- forceArgs doesn't work if $conf['exclude'] is not set.
- overruleArgs doesn't work if $conf['exclude'] is not set.

Solution:
- Add a new helper method to t3lib_div to diff multi dimensional arrays
- Explode the return value of t3lib_div::getIndpEnv('QUERY_STRING') to 
the same multi dimensional array that t3lib_div::_GET() and friends return
- Fix handling of forceArgs and overruleArgs

Notes:
- This fix is practically a rewrite of getQueryArguments (making it much 
shorter and better understandable).
- There is one possible drawback that might not work exactly as before, 
if you feed the method with an overruleArray like
$overruleArray = array(
	'key1[key11]' = 'value11'
);
This is not handled after the patch, it expects:
$overruleArray = array(
	'key1' => array(
		'key11' => 'value11'
	),
);
There was no documentation for this edge case, but I'm unsure about 4.3 
because of this. Any opinions? Is this a real issue for extensions? 
Should we add some workaround for this case?
- getQueryArguments() is practically a static method, I added the 
public, but not the static keyword to not break backwards compatibility.
- The patch set comes with test cases which feed the method with edge 
cases to show what exactly didn't work and what is working after 
applying the patch. Enjoy.

Regards
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 11239_02_content.diff
Type: text/x-patch
Size: 3571 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091227/344b32be/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 11239_02_content_testcase.diff
Type: text/x-patch
Size: 7155 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091227/344b32be/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 11239_02_div.diff
Type: text/x-patch
Size: 1160 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091227/344b32be/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 11239_02_div_testcase.diff
Type: text/x-patch
Size: 2593 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20091227/344b32be/attachment-0003.bin>


More information about the TYPO3-team-core mailing list