[TYPO3-core] RFC: 15211: listQuery does not handle passed in int values correctly

Ernesto Baschny [cron IT] ernst at cron-it.de
Sat Jul 24 08:54:03 CEST 2010


Hi,

Bjoern Pedersen schrieb am 23.07.2010 10:48:
> Bug tracker reference: http://bugs.typo3.org/view.php?id=15211
> 
> the page group access check calls t3lib_db with an int array (obtained
> by t3lib_div::intExplode).
> 
> if the group number matches ord(',') strpos(',', value) returns a match
> causing an ValueErrorException.
> 
> Solution: check  that $value is a string, otherwise convert it with strval.
> 
> 
> Note: The  bugtracker contains two tests showing the strange strpos
> behaviour.

I did a minor performance modification to your solution, which is let
PHP cast the value to a "(string)" on use, instead of doing costly
checks if "is_string()".

The attached patch was commited to trunk, and also include a test case
proving the wrong behaviour of listQuery on ord(',') and that it works
after the fix.

Thanks for your help and for spotting that (probably difficult to
uncover) bug!

Commited to trunk (rev. 8259)

Cheers,
Ernesto
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 15211-v2.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100724/9e008c24/attachment.asc>


More information about the TYPO3-team-core mailing list