[TYPO3-core] RFC: #10861: Eval of double2 doesn't work
Ernesto Baschny [cron IT]
ernst at cron-it.de
Fri May 15 23:35:19 CEST 2009
Steffen Kamper schrieb:
> after a conspirative session with Bernhard :-) we found the check is not
> enough. Wrong entry ends up in NaN which should not happen at any time.
>
> So i rewrote both methods of eval and tested with any possible input
> (also nonsense), result is attached version 2.
> Maybe it looks complicate, and indeed it is: Removing not valid chars,
> checking for negative, splitting a.s.o. But this way each entry is
> eval'ed to a double and not to 0.00 if illegal chars are found.
... the conspiracy continues!
We had another session here during bug night (Steffen Kamper, Peter
Foerger). We decided to make a phpunit test to simulate the TCEmain part
of the double2 evaluation. The "javascript" was still manually tested.
Just install the test-extension from Steffen (attached to the bug
report), create a new record and try these values in the input form:
-0,5
1000
1000,10
1000,0
600.000.000,00
60aaa00
etc. They should always return the double2 value, and in the first case
the correct "-0.50".
So +1 from my side on this fix.
Cheers,
Ernesto
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug10861-v3.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090515/8ea5d3e6/attachment.txt
More information about the TYPO3-team-core
mailing list