[TYPO3-core] RFC: #8064: Split does not work with returnKey = 0

Oliver Hader oliver at typo3.org
Wed Apr 9 01:24:11 CEST 2008


Hi Dirk,

Dirk Weise schrieb:
> this is a SVN patch request.
> 
> Type: Bugfix
> 
> Branches: 4_2, 4_1 ?
> 
> Bugtracker Reference:
> http://bugs.typo3.org/view.php?id=8064
> 
> Problem:
> You can't use split to return the first element of a splited value. It 
> will return the whole string instead.
> split {
>   token.char = 10
>   returnKey = 0
> }
> 
> Checking a var that  contains a zero in an if statement always resolves 
> to false....
> 
> Resolution:
> Checking with is_numeric().
> See attached patch, it's a no brainer.

+1 on reading when using t3lib_div::testInt() instead of is_numeric().
The patch can IMO also be committed to TYPO3_4-1.

olly
-- 
Oliver Hader
TYPO3 Core Team


More information about the TYPO3-team-core mailing list