[TYPO3-core] RFC #15020: Enhancement of t3lib_div::testInt
Christian Kuhn
lolli at schwarzbu.ch
Thu Aug 12 21:41:04 CEST 2010
Michiel Roos [netcreators] wrote:
> Branches:
> - trunk
4.4 and trunk, there is a real bugfix in it (see below).
> t3lib_div::testInt can be optimized by making use of the PHP version of
> testInt called: is_int.
As stated, is_int doesn't work in this case, but we can achieve the same
with some clever casting.
+1 on reading and testing for attached v4.
The attached version fixes a false negative with "string" integers
starting with a zero. Furthermore with php 5.3.2 the three false array
tests returned true with the old version for me.
Reproduce:
Apply tests, most will work, but some fail. Apply testInt patch and get
green bar feeling. Special thanks to Christian Futterlieb for the
initial unit tests!
As the patch already got several +1, but changed during development, I'd
like to see at least one additional review from anyone for this version
to make it commit ready.
Thanks
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 15020_v4.diff
Type: text/x-patch
Size: 729 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100812/c250f319/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 15020_v4_test.diff
Type: text/x-patch
Size: 1891 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100812/c250f319/attachment-0001.bin>
More information about the TYPO3-team-core
mailing list