diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-05 14:49:55 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-05 14:49:55 +0000 |
commit | 4d18e65acd91aa99bb718bc2f8aebc0670118f00 (patch) | |
tree | 97ad4795c1add641fbf57b1e9974dba26d2e5ab9 /includes | |
parent | 0014a64d37e42ccc63f0b44a0ce32a06fca67b1d (diff) | |
download | brdo-4d18e65acd91aa99bb718bc2f8aebc0670118f00.tar.gz brdo-4d18e65acd91aa99bb718bc2f8aebc0670118f00.tar.bz2 |
- Patch #599804 by effulgentsia, catch, moshe weitzman, webchick: don't always set the Content-Type header.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index 18b8fed2b..d0e92f9ee 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -2837,6 +2837,14 @@ function drupal_deliver_page($page_callback_result, $default_delivery_callback = * @see drupal_deliver_page */ function drupal_deliver_html_page($page_callback_result) { + // Emit the correct charset HTTP header, but not if the page callback + // result is NULL, since that likely indicates that it printed something + // in which case, no further headers may be sent, and not if code running + // for this page request has already set the content type header. + if (isset($page_callback_result) && is_null(drupal_get_http_header('Content-Type'))) { + drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); + } + // Menu status constants are integers; page content is a string or array. if (is_int($page_callback_result)) { // @todo: Break these up into separate functions? @@ -4506,8 +4514,6 @@ function _drupal_bootstrap_full() { set_error_handler('_drupal_error_handler'); set_exception_handler('_drupal_exception_handler'); - // Emit the correct charset HTTP header. - drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); // Detect string handling method unicode_check(); // Undo magic quotes |