[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#285363: marked as done (apache: AddDefaultCharset might not work)



Your message dated Wed, 16 Sep 2009 20:34:04 +0100
with message-id <1253129644.156372.2611.nullmailer@kmos.homeip.net>
and subject line Package apache has been removed from Debian
has caused the Debian Bug report #285363,
regarding apache: AddDefaultCharset might not work
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
285363: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=285363
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apache
Version: 1.3.33-2
Severity: normal

When using the latest version of 'apache' and 'php4' on sid,
something weird happens with the charset attribute in the headers
sent out by Apache.
I believe this is a double problem (in both Apache and PHP) but feel
free to reassign if you think this belongs to only one of the packages.

The PHP side:
No matter what combination of default_mimetype and default_charset is
given in php.ini, or empty values even, PHP will always output an empty
charset for me.
 "Content-type: text/html; charset="

The Apache side:
If such a statement is present, apache skips adding a charset (even if
requested) because it thinks it already has a charset appended to the
header.
The source has a FIXME about verification in this case, this is what I'm
trying to do here.

Note that the charset directive works fine for e.g. *.html files, so
it's certainly some PHP involvement. But I still think Apache should
override in this case.

A patch which fixes the issue is attached.
It's rather a patch proposal though - all I want is to get my pages in
utf-8 without writing a content-modifying proxy :)

Depending on the reply, I will open another report with the PHP package.

Josef

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.9-powerpc
Locale: LANG=pt_BR, LC_CTYPE=pt_BR (charmap=ISO-8859-1)

Versions of packages apache depends on:
ii  apache-common               1.3.33-2     Support files for all Apache 
webse
ii  debconf                     1.4.39       Debian configuration management 
sy
ii  dpkg                        1.10.24      Package maintenance system for 
Deb
ii  libc6                       2.3.2.ds1-18 GNU C Library: Shared libraries 
an
ii  libdb4.2                    4.2.52-17    Berkeley v4.2 Database Libraries 
[
ii  libexpat1                   1.95.8-1     XML parsing C library - runtime 
li
ii  libmagic1                   4.10-3       File type determination library 
us
ii  logrotate                   3.7-2        Log rotation utility
ii  mime-support                3.28-1       MIME files 'mime.types' & 
'mailcap
ii  perl                        5.8.4-3      Larry Wall's Practical Extraction 

-- debconf information excluded
--- http_protocol.c.old	2004-12-12 20:38:25.300493184 +0100
+++ http_protocol.c	2004-12-12 20:48:09.746643864 +0100
@@ -82,6 +82,7 @@
 	NULL };
     char **pcset;
     core_dir_config *conf;
+    int addcharset = 1, addcharsetname = 1;
 
     conf = (core_dir_config *)ap_get_module_config(r->per_dir_config,
                                                    &core_module);
@@ -93,17 +94,22 @@
     }
 
     if (ap_strcasestr(type, "charset=") != NULL) {
-	/* already has parameter, do nothing */
-	/* XXX we don't check the validity */
-	;
+        if (*(ap_strcasestr(type, "charset=") + strlen("charset="))) {
+            /* already has parameter, do nothing */
+            /* XXX we don't check the validity */
+            addcharsetname = 0;
+	} else {
+            /* empty charset= statement */
+            addcharset = 0;
+        }
     }
-    else {
+    if (addcharsetname) {
     	/* see if it makes sense to add the charset. At present,
 	 * we only add it if the Content-type is one of needcset[]
 	 */
 	for (pcset = needcset; *pcset ; pcset++) {
 	    if (ap_strcasestr(type, *pcset) != NULL) {
-		type = ap_pstrcat(r->pool, type, "; charset=", 
+		type = ap_pstrcat(r->pool, type, (addcharset ? "; charset=" : ""), 
                                   conf->add_default_charset_name, NULL);
 		break;
 	    }

--- End Message ---
--- Begin Message ---
Version: 1.3.34-4.1+rm

You filled the bug http://bugs.debian.org/285363 in Debian BTS
against the package apache. I'm closing it at *unstable*, but it will
remain open for older distributions.

For more information about this package's removal, read
http://bugs.debian.org/418266. That bug might give the reasons why
this package was removed and suggestions of possible replacements.

Don't hesitate to reply to this mail if you have any question.

Thank you for your contribution to Debian.

--
Marco Rodrigues


--- End Message ---

Reply to: