Closed Bug 50616 Opened 24 years ago Closed 22 years ago

Proxy port number with leading zero interpreted as octal


(Core :: Preferences: Backend, defect, P3)






(Reporter: rcummins, Assigned: gagan)


When using preferences to configure proxy settings, the entered port number is
normally interpreted as decimal, except when there's a leading zero, in which
case Mozilla interprets it as an octal value.  Although this is an interesting
feature, I wonder if it's on purpose - I stumbled across this by mistake because
I'm lazy and tried to tab between the proxy hostname field and the proxy port
field, and didn't bother to replace the original value (0), instead just typing
to the right of it.

Reproduce by going into Preferences -> Advanced -> Proxy, enter "0100" as a
proxy port value, click "OK", go back into Preferences -> Advanced -> Proxy, and
the proxy port value has magically changed to 64.
backend issue
Assignee: matt → gagan
over to networking...
Component: Preferences → Networking
QA Contact: sairuh → tever
Confusing to the user for no reason.  Fix should be easy.
Severity: normal → minor
Ever confirmed: true
Target Milestone: --- → Future
Still broken nearly three months later in build 2000111908.
10 years of technical support, I never thought I'd say this... but since it does
convert and save the octal value, doesn't that make it a "feature?" Now I know
where to go when I need to convert octal to decimal...
Open Networking bugs, qa=tever -> qa to me.
QA Contact: tever → benc
Moved to preferences backend and severity normal, it's a little more insidious
than I thought.  *Any* preference that normally takes an integer as a value is
susceptible to this bug; entering a cache size of 01000 ends up as 512KB, 'wrap
plain text messages at 072 characters' becomes 58 characters, remember history
for 010 days becomes 8 days, etc., the point being that it's not just proxy port
settings being affected.

Maybe the problem is in 
nsPrefBranch::SetIntPref /modules/libpref/src/nsPrefBranch.cpp around line 259 or 
PREF_SetIntPref /modules/libpref/src/prefapi.c around line 579
too bad me too stupid to figure out.
Severity: minor → normal
Component: Networking → Preferences: Backend
OS: Windows 95 → All
Hardware: PC → All
While doing functional tests, I noticed that if you tab into the field, the
cursor appears behind the "0", rather than selecting the contents of the field.

So if you do: + <tab> + 443 + <return>, you get "0443" when you hit
return, and then octal conversion occurs.

For Proxy, could we hide this problem by changing text selection when tabbing
into the field?

Keywords: mozilla0.9.7
Since the problem affects more than just proxy settings (see my comment above), 
one would get more of a return if one just fixed the problem instead of trying 
to hide it for special cases.

*** This bug has been marked as a duplicate of 63117 ***
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.