javascript: protocol is case sensitive.

VERIFIED FIXED

Status

()

P2
critical
VERIFIED FIXED
19 years ago
19 years ago

People

(Reporter: desale, Assigned: jst)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta2+][will be minus on 6/15])

Attachments

(2 attachments)

(Reporter)

Description

19 years ago
protocol javascript: is case sensitive and does not allow a single alphabet in 
upper case [Like Javascript:, JAVASCRIPT:]

And there are several sites which use "Javascript:" instead of "javascript:"

According to RFC 1738 [http://www.isi.edu/in-notes/rfc1738.txt]
In general, URLs are written as follows:

       <scheme>:<scheme-specific-part>

   A URL contains the name of the scheme being used (<scheme>) followed
   by a colon and then a string (the <scheme-specific-part>) whose
   interpretation depends on the scheme.

   Scheme names consist of a sequence of characters. The lower case
   letters "a"--"z", digits, and the characters plus ("+"), period
   ("."), and hyphen ("-") are allowed. For resiliency, programs
   interpreting URLs should treat upper case letters as equivalent to
   lower case in scheme names (e.g., allow "HTTP" as well as "http").

So javascript: protocol could also be allowed to use with uppercase letters.

BUILDS: 2000-060508.

STEPS TO REPRODUCE:
1] Please load the testcase I'm going to attach with above specified builds.
2] You'll see four links. Click these all links one by one and observe.

EXPECTED RESULTS:
All four links should generate alerts. [All links use different case combination 
for protocol javascript:]

ACTUAL RESULTS:
One first link generates alert.
(Reporter)

Comment 1

19 years ago
Created attachment 9734 [details]
Testcase attached.
(Reporter)

Comment 2

19 years ago
Nominating nsbeta2 because multile site use Javascript: istead of javascript:
Keywords: nsbeta2
Priority: P3 → P2
(Assignee)

Comment 3

19 years ago
Hmm, this is interesting, mixed case javascript urls work if you type them in
the url bar, I'll have a look why they don't work in links any more (they used
to, I'm sure)...
Status: NEW → ASSIGNED
OS: Windows 95 → All
Hardware: PC → All

Comment 4

19 years ago
*** Bug 41730 has been marked as a duplicate of this bug. ***

Comment 5

19 years ago
Need info.  What does 4.x do in this case?  What about other protocols?  (file:,
http:)
Whiteboard: [need info]
(Assignee)

Comment 6

19 years ago
4.x treats the protocol in a URL caseinsensitively, so this could affect a lot
of sites out there, I think this is a problem only for javascript: urls in
mozilla.
(Assignee)

Comment 7

19 years ago
Aha! Found the problem, the fix is a oneliner in the docshell, I'll attach a
patch, this should definitely be nsbeta2+
(Assignee)

Comment 8

19 years ago
Created attachment 9801 [details] [diff] [review]
Proposed fix
(Reporter)

Comment 9

19 years ago
I also think this should be nsbeta2+ Johnny.
It could affect tons of sites out there.

COOL You Have Fix.

Comment 10

19 years ago
Putting on [nsbeta2+] [will be minus on 6/15] radar.
Whiteboard: [need info] → [nsbeta2+][will be minus on 6/15]
(Assignee)

Comment 11

19 years ago
I just checked in the patch, JaVaScRiPt URL's work again!

Marking FIXED.

Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Reporter)

Comment 12

19 years ago
Marking VERIFIED. 
Working perfect now. Tested with 2000-060809 on Win-95.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.