#6 Fixes 0 after decimal point

open
nobody
None
5
2012-10-05
2007-02-07
Josh
No

There was an issue in the json library with numbers having a 0 after a decimal point (i.e. 16.07, 1.023).

The problem is on line 464 of json.php.

The condition of the while loop checks for $this->next()

If $this->next() returns '0', the loop skips and everything after the decimal is dropped.

This is fixed by changing the check to:

$this->next() !== ''

Even if the character returned is '0' the loop will continue.

Discussion

  • Josh
    Josh
    2007-02-07

    updated json.php file

     
    Attachments