Closed Bug 69043 Opened 24 years ago Closed 24 years ago

javascript: href mangled when character reference is used

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 51355
mozilla1.0

People

(Reporter: markus.kuehni, Assigned: jst)

Details

(Keywords: dom0)

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; 0.8) Gecko/20010215 BuildID: 2001011508 A javascript: href containing an HTML character reference (numeric encoding using the &#ddd; form) is re-encoded using the URI %xx form. This breaks the JavaScript code. Reproducible: Always Steps to Reproduce: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Testcase javascript: href problem</title> </head> <body> <h1>Testcase <code>javascript:</code> href problem</h1> <p> Shows how Mozilla 0.8 is confused by character references in <code>javascript:</code> hrefs. It seems to find it necessary to re-encode the href value using the %xx notation. While this is probably the right thing to do for ordinary URIs it obviously breaks JavaScript: </p> <ol> <li>Please open the JavaScript console (<var>Tasks/Tools/JavaScript Console</var>)</li> <li><a href="javascript:alert('&#183;Hello World&#183;')">Test it!</a> (should display an alert box showing <code>&#183;Hello World&#183;</code>)</li> </ol> <p> The code works fine on IE 5.5 and Opera 5.02. </p> </body> </html>
Attached file Test case
Confirmed under 2001021606/Linux as well.
Confirming and setting OS all.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
updating component.
Assignee: asa → jst
Component: Browser-General → DOM Level 0
QA Contact: doronr → desale
Keywords: dom0
I think this might not be a bug, ccing hixie.
Yet one more problem with escaping/unescaping javascript: URL's. Trying for mozilla1.0
Hardware: PC → All
Target Milestone: --- → mozilla1.0
I think this is a duplicate of bug 51355.
*** This bug has been marked as a duplicate of 51355 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Verified Duplicate.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: