← Back to team overview

mahara-contributors team mailing list archive

[Bug 1394330] A change has been merged

 

Reviewed:  https://reviews.mahara.org/4028
Committed: http://gitorious.org/mahara/mahara/commit/d98f2ada6289d364c628f8910cc4713be2282857
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    1.10_STABLE

commit d98f2ada6289d364c628f8910cc4713be2282857
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:
  Fix Committed
Status in Mahara 1.10 series:
  Fix Committed
Status in Mahara 1.8 series:
  Fix Committed
Status in Mahara 1.9 series:
  Fix Committed

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