Closed
Bug 254434
Opened 21 years ago
Closed 21 years ago
about:config should not use eval
Categories
(SeaMonkey :: UI Design, defect)
SeaMonkey
UI Design
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8alpha3
People
(Reporter: Biesinger, Assigned: Biesinger)
Details
Attachments
(1 file)
2.02 KB,
patch
|
timeless
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #155277 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #155277 -
Flags: review?(timeless)
Attachment #155277 -
Flags: review?(timeless) → review+
Comment 2•21 years ago
|
||
+ var val = parseInt(result.value);
+ if (isNaN(val)) {
This would lead to inputs like "32xyz" be accepted as 32. Also, "067" would be
interpreted as 55.
Better use
val = Number(result.value);
Assignee | ||
Comment 3•21 years ago
|
||
> "067" would be interpreted as 55.
that's fine, if you enter octal numbers you can expect them to be interpreted
as such
But per irc discussion w/ neil I'll use parseInt(val) == val, so that .5 (for
example) is not accepted
hmm, or would Number(val) == val be better?
Comment 4•21 years ago
|
||
Comment on attachment 155277 [details] [diff] [review]
patch
parseInt(val) == val would wronly pass "NaN".
(result.value - 0) != (result.value | 0) is another option.
Attachment #155277 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8alpha3
Assignee | ||
Comment 5•21 years ago
|
||
checked in, using | 0 != - 0
Checking in xpfe/global/resources/content/config.js;
/cvsroot/mozilla/xpfe/global/resources/content/config.js,v <-- config.js
new revision: 1.18; previous revision: 1.17
done
Checking in xpfe/global/resources/locale/en-US/config.properties;
/cvsroot/mozilla/xpfe/global/resources/locale/en-US/config.properties,v <--
config.properties
new revision: 1.2; previous revision: 1.1
done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•21 years ago
|
Product: Core → Mozilla Application Suite
You need to log in
before you can comment on or make changes to this bug.
Description
•