mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #22524
[Bug 1394330] A change has been merged
Reviewed: https://reviews.mahara.org/3994
Committed: http://gitorious.org/mahara/mahara/commit/3743dcf68d1058f647081cf5d29662181978fd01
Submitter: Son Nguyen (son.nguyen@xxxxxxxxxxxxxxx)
Branch: master
commit 3743dcf68d1058f647081cf5d29662181978fd01
Author: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
Date: Thu Nov 20 09:04:00 2014 +1300
Always specify what base type we want returned from parseInt()
Bug 1394330
In most places in mahara we specify that we want base 10 number
returned (or base 16 in case of a hexidecimal css colour)
But there are a few places where we don't specify the radix at all
It's best practice to always include the radix because for older
browsers it interprets leading 0 as octal by default.
Also makes it clearer to developers what type of number is expected to
be retrieved from the string.
Change-Id: Iaecc85cbed875f85b313188c4e96cc1b77c77b31
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1394330
Title:
Improper use of the parseInt javascript function
Status in Mahara ePortfolio:
In Progress
Status in Mahara 1.10 series:
New
Status in Mahara 1.8 series:
New
Status in Mahara 1.9 series:
New
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1394330/+subscriptions
References