Closed Bug 254434 Opened 21 years ago Closed 21 years ago

about:config should not use eval

Categories

(SeaMonkey :: UI Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha3

People

(Reporter: Biesinger, Assigned: Biesinger)

Details

Attachments

(1 file)

Attachment #155277 - Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #155277 - Flags: review?(timeless)
Attachment #155277 - Flags: review?(timeless) → review+
+ 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);
> "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 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+
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8alpha3
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
Product: Core → Mozilla Application Suite
Component: XP Apps: GUI Features → UI Design
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: