php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22084 Content-Type: text/css, broaken bigtime in new versions of PHP
Submitted: 2003-02-05 17:58 UTC Modified: 2003-02-06 08:34 UTC
From: tlb at rapanden dot dk Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.2.3 OS: Linux Mandrake 9.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tlb at rapanden dot dk
New email:
PHP Version: OS:

 

 [2003-02-05 17:58 UTC] tlb at rapanden dot dk
As written in the RFC this "Content-Type: text/css" should be interpreted as
"Content-Type: text/css; charset=ISO-8859-1" by 
any HTTP 1.0/1.1 software, but it's not by newer version of php and it's changed to "Content-Type: text/html; charset=" and that's plain wrong, the one provided to Apache is even more broaken, "Content-Type: text/html; charset=iso-8859-15" there by breaking
support for standard compliant Mozilla/Netscape 7.0 and making any CSS used by non functional.


http://www.jorendorff.com/articles/unicode/unicode-http.html

and

ftp://ftp.isi.edu/in-notes/rfc2616.txt

3.4.1 Missing Charset

   Some HTTP/1.0 software has interpreted a Content-Type header without
   charset parameter incorrectly to mean "recipient should guess."
   Senders wishing to defeat this behavior MAY include a charset
   parameter even when the charset is ISO-8859-1 and SHOULD do so when
   it is known that it will not confuse the recipient.

   Unfortunately, some older HTTP/1.0 clients did not deal properly with
   an explicit charset parameter. HTTP/1.1 recipients MUST respect the
   charset label provided by the sender; and those user agents that have
   a provision to "guess" a charset MUST use the charset from the

and

test.php:
<?
header('Content-Type: text/css');

?>

[tlb@tlb tlb]$ wget -O - -d http://tlb.rapanden.dk/test.php
DEBUG output created by Wget 1.8.2 on linux-gnu.

--00:14:54--  http://tlb.rapanden.dk/test.php
           => `-'
Resolving tlb.rapanden.dk... done.
Caching tlb.rapanden.dk => 195.249.214.150
Connecting to tlb.rapanden.dk[195.249.214.150]:80... connected.
Created socket 3.
Releasing 0x80830e8 (new refcount 1).
---request begin---
GET /test.php HTTP/1.0
User-Agent: Wget/1.8.2
Host: tlb.rapanden.dk
Accept: */*
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... HTTP/1.1 200 OK
Date: Wed, 05 Feb 2003 23:13:26 GMT
Server: Apache-AdvancedExtranetServer/1.3.26 (Mandrake Linux/6.1mdk) PHP/4.2.3
Vary: Host
X-Powered-By: PHP/4.2.3
Connection: close
Content-Type: text/html; charset=iso-8859-15
Length: unspecified [text/html]

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-06 08:34 UTC] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

4.3.0 was released over a month ago..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 11:01:28 2024 UTC