Closed Bug 527603 Opened 15 years ago Closed 15 years ago

img src does not display dynamic image with .php extension

Categories

(Firefox :: General, defect)

3.5 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: js781707, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Dynamic images are not displayed when the file extension is .php Example: <img src="http://website.com/myimage.php" /> myimage.php on the server: header("Content-Type: image/gif"); header("Location: http://website.com/some-image.gif"); Reproducible: Always Steps to Reproduce: 1. Create a PHP script using dynamic images, i.e <?php header("Content-Type: image/gif"); header("Location: http://website.com/some-image.gif"); exit; ?> 2. Create the html with an img tag using the php file as the src, i.e. <img src="http://website.com/myimage.php" /> Actual Results: No image is displayed Expected Results: An image should have displayed A temp fix is to have a random extension in the img src URL, i.e. <img src="http://website.com/myimage.php?x=.anything" />
Version: unspecified → 3.5 Branch
What is the content-type sent by the server for this URL ? ( You can use http://web-snffer.net for public URLs) Extensions doesn't matter and it can only be a content-type header issue.
Matthias, the Content type is that of the image type displayed (image/gif, image/jpg, etc..). Not to worry, I found the cause. It is Apache sending this header: X-Pad: avoid browser bug Seems the img src URL that I was using in my HTML code was exactly the length that causes Apache to send this header. 1 character longer or shorter and the X-Pad header is not sent and the image displays fine. Cheers
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
The borwser ignores this header, it doesn't explain why the image isn't displayed. The header itself is for an old Bug in old Netscape browsers.
You need to log in before you can comment on or make changes to this bug.