Improper use of the parseInt javascript function
Bug #1394330 reported by
Robert Lyon
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Robert Lyon | ||
1.10 |
Fix Released
|
High
|
Unassigned | ||
1.8 |
Fix Released
|
High
|
Unassigned | ||
1.9 |
Fix Released
|
High
|
Unassigned |
Bug Description
The parseInt() function needs to specify that it is using radix 10
Older browsers use the octal radix (8) as default so parseInt('010') will return '8' rather than '10' that we might expect.
In many places the function is used correctly, eg: parseInt(match[1], 10);
But not all places are indicating to use a base 10 radix.
So I'll clean up the places it is not used so that we know to return a base 10 number.
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Patch for "master" branch: https:/ /reviews. mahara. org/3994