javascript - parseInt('08') - (or with '09') returns 0

Bug #291027 reported by attand
2
Affects Status Importance Assigned to Milestone
firefox-3.0 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: firefox-3.0

I am displaying two days in two digit using printf of php. Now when this value is passed to javascript, i get 0 in following cirumstances - only for these two nos. I am using firefox 3.0.3

parseInt('08') and parseInt(''09')

I then tested in Error Console of FF and confirmed that i get 0 in these two nos.
My linux is Ubuntu 7.10 and 8.04 on Acer laptop and Dell vostro systems
i tested from 0 till 15.

i amusing PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23 2008 06:44:49) and FireFox 3.0.3

====================================================

Tnanks in advance for the solution

ProblemType: Bug
Architecture: i386
Date: Thu Oct 30 15:30:32 2008
DistroRelease: Ubuntu 8.04
Package: firefox-3.0 3.0.3+build1+nobinonly-0ubuntu0.8.04.1
PackageArchitecture: i386
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_IN.UTF-8
 SHELL=/bin/bash
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-21-server i686

Tags: apport-bug
Revision history for this message
attand (attand-gmail) wrote :
Revision history for this message
Alexander Sack (asac) wrote :

strings that star with a leading "0" are considered octal encoded so this is a feature. just dont put the 0 in front.

Changed in firefox-3.0:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.