[TYPO3-core] RFC #5595: Bug: Fix in evalFunc_parseDouble() in t3lib/jsfunc.evalfield.js

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Jul 1 18:35:04 CEST 2008


Sylvère "Siller" Störmann wrote: on 01.07.2008 16:11:

>> Looks good, but missing the part that saves the form (TCEmain). Please 
>> also modify t3lib/class.t3lib_tcemain.php accordingly (function 
>> checkValue_input_Eval), because there also the "intval()" php function 
>> is used on the integer part of the splitted value, causing the same 
>> effect.

> thanks, I completely had forgotten about that part. ;)

>> So the JS on the client is ok, as soon as you send it to the server, 
>> TYPO3 will strip the "-" again.

> Additional patches for class.t3lib_tcemain.php attached. Now it works on 
> the server side as well.

This addition wasn't clear to me:

  					$value = intval(str_replace(' ','',$value)).'.'.substr($theDec,0,2);
+					$value = ($value * 100 ? $neg.$value : $value);

As far as I see, $neg is either "" or "-" at this point. Wouldn't it be 
enough simply to prefix $neg to $value? $value is already has the "-" 
stripped off by your patch.

Cheers,
Ernesto


More information about the TYPO3-team-core mailing list