Closed Bug 276972 Opened 20 years ago Closed 20 years ago

View source displays source of .js.php web page incorrectly in some cases

Categories

(Toolkit :: View Source, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

VERIFIED DUPLICATE of bug 43267

People

(Reporter: dionyziz, Assigned: bugs)

References

()

Details

Attachments

(5 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; el-GR; rv:1.7.3) Gecko/20041027 Firefox/1.0RC1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; el-GR; rv:1.7.3) Gecko/20041027 Firefox/1.0RC1

When loading a certain file into the browser with the .js.php extension from a
PHP-supporting server the View Source command does not display the source
correctly. This only occurs when loading the .php file from a server, and not
just locally, for instnace load C:\foo\test.js.php or C:\foo\test.js and the
problem is not there. The .js.php where the problem occurs is the following:

tsks = "<td id=\"hello" + "" + "\">";

It is important that the first string contains an HTML tag(<td>); if it didn't
the problem would not occur. Here's what the "View Source" command displays:

tsks = "<td id=\"hello" +  + \>";

Which is not correct. I have uploaded a few screenshots showing what exactly I
mean. 
Here is the js file: 
http://dionyziz.omg.gr/moz/test.js.php

Here is a screenshot of the file loaded into FireFox: 
http://dionyziz.omg.gr/moz/browse_local.png

Here is a screenshot of the real source of the js file: 
http://dionyziz.omg.gr/moz/real_source.png

Here is how the source is displayed using the View Source utility: 
http://dionyziz.omg.gr/moz/view_source_local.png

To verify that the certain data is really sent to the browser and is displayed
incorrectly rather than received incorrectly, I tried getting the same file
using the netcat TCP/IP utility. Here's a screenshot:
http://dionyziz.omg.gr/moz/browse_netcat.png

I use Mozilla FireFox 1.0 RC1 Greek. My operating system is Windows XP
Professional Greek with Service Pack 1.

Reproducible: Always

Steps to Reproduce:
1. Create a file named test.js.php. Paste the following contents into it:
tsks = "<td id=\"hello" + "" + "\">";
2. Save the file and move it to the public htdocs directory of your local
server, and make sure the server is configured to parse .php files.
3. Load the file in your web browser (by connecting to your local server)
4. Use the View Source command to open up the window containing the source of
the document.
Actual Results:  
The source displayed in the Source Window is not the one that was sent to the
browser by the server.

Expected Results:  
The View Source command should, instead, have displayed the actual source of the
document sent to the browser.

Here's my buildconfig:

about:buildconfig

Build platform
target
i686-pc-cygwin

Build tools
Compiler 	Version 	Compiler flags
$(CYGWIN_WRAPPER) cl 	12.00.8804 	-TC -nologo -W3 -nologo -Gy -Fd$(PDBFILE)
$(CYGWIN_WRAPPER) cl 	12.00.8804 	-TP -nologo -W3 -nologo -Gy -Fd$(PDBFILE)

Configure arguments
--disable-ldap --disable-mailnews
--enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth
--enable-crypto --disable-composer --enable-single-profile
--disable-profilesharing --enable-optimize --disable-debug --disable-tests
--enable-static --disable-shared --enable-official-branding
Thank you for that very detailed and comprehensive bug report. However, it's a
duplicate of bug 43267 which has already been fixed for the next release. (You
only see it when it's delivered from your server because PHP sends files as
text/html by default, so it's being parsed for view-source as very invalid HTML,
but now we handle that very invalid HTML much better.)

*** This bug has been marked as a duplicate of 43267 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: