Closed Bug 299345 Opened 20 years ago Closed 19 years ago

entities not interpreted in <script>

Categories

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

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: kscott, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050610
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050610

<script language="JavaScript1.2" type="text/javascript">
<!--
    location.replace("&#x68;&#x6F;&#x6D;&#x65;&#x2E;&#x68;&#x74;&#x6D;&#x6C;");
    //ASCII String URL --> location.replace("home.html");
//-->
</script>
This DOM function should route to the specfied file using UNICODE characters for
address hiding/security purposes.  UNICODE currently DOES work within a HTML
document; spcifically within SRC="", HREF="" tags.  This function has been
tested with other browsers (coughing [Hearing Booo's] IE 6.0) which does
function correctly.

Reproducible: Always

Steps to Reproduce:
1.Insert UNICODE characters into location.replace(""); within JavaScript
Note: HEX or DEC have both been tested.


Actual Results:  
Server only receives the first ASCII character within the URL string.

Not Found
The requested URL /www/Bugs/& was not found on this server.
Apache/2.0.50 (Win32) Server

Expected Results:  
The home.html page should have loaded

http://www.intrinsictechnologies.com/Bugs/index.html routes to
http://www.intrinsictechnologies.com/Bugs/home.html

Saying the following text:
Congratulations!!!
This page will be displayed when ASCII text is entered into
the location.replace(""); DOM function.  This page will not
display when UNICODE is entered into the location.replace("");
function for location hiding or security reasons.
Assignee: mrbkap → general
Component: ViewSource → DOM: Level 0
Product: Mozilla Application Suite → Core
QA Contact: doronr → ian
Version: unspecified → Trunk
Attached file simpler testcase
same with alert(), so it's not due to the replace function
Assignee: general → parser
Component: DOM: Level 0 → HTML: Parser
QA Contact: ian → mrbkap
Summary: UNICODE can not be used inside DOM location.replace(""); function. → entities not interpreted in <script>
mrbkap blames DOM
Assignee: parser → general
Component: HTML: Parser → DOM
QA Contact: mrbkap → ian
Er, why would this be DOM? (Note that it works in XHTML)
In HTML, the contents of <SCRIPT> are CDATA, see
http://www.w3.org/TR/html4/types.html#type-cdata (especially the paragraph
beginning with "Although..."). This works in XHTML because XML doesn't have this
concept of elements containing CDATA. Therefore (if this bug is valid), it has
to be fixed in either content or the DOM code.
So why isn't this INVALID then?
I'm not as well versed in the DOM specs, and comment 0 implied that IE expands
these entities somewhere. I'll mark this INVALID and if someone can quote a spec
(or give a _really_ good reason to support this) they can reopen.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
*** Bug 353719 has been marked as a duplicate of this bug. ***
First of all, Bug 353719 is *not* a duplicate of this bug. Here's why....

While the title and error description of Bug 353719 is correct, this bug's isn't: It is invalid to replace entities <script>, yet it's valid and necessary that they must replaced in URLs for the location object.

Please reopen Bug 353719!
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: