summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-09-30 18:36:02 +0000
committerDries Buytaert <dries@buytaert.net>2009-09-30 18:36:02 +0000
commit7178f6b17398b10105f8246b11c8d10b14ae39a6 (patch)
treece4bc701c146ae17f4e38190565c4839c22956ff /includes
parenta8f8a26f6d77f6aca8821e28e66ea253687d7d59 (diff)
downloadbrdo-7178f6b17398b10105f8246b11c8d10b14ae39a6.tar.gz
brdo-7178f6b17398b10105f8246b11c8d10b14ae39a6.tar.bz2
- Patch #451604 by brianV, sun | Dries, c960657: rename drupal_set_header().
Diffstat (limited to 'includes')
-rw-r--r--includes/bootstrap.inc22
-rw-r--r--includes/common.inc18
-rw-r--r--includes/database/database.inc2
-rw-r--r--includes/file.inc2
-rw-r--r--includes/theme.maintenance.inc4
-rw-r--r--includes/xmlrpcs.inc4
6 files changed, 26 insertions, 26 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index f2776bb21..a5a7d5d8b 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -843,7 +843,7 @@ function drupal_load($type, $name) {
* @param $append
* Whether to append the value to an existing header or to replace it.
*/
-function drupal_set_header($name = NULL, $value = NULL, $append = FALSE) {
+function drupal_add_http_header($name = NULL, $value = NULL, $append = FALSE) {
// The headers as name/value pairs.
$headers = &drupal_static(__FUNCTION__, array());
@@ -885,8 +885,8 @@ function drupal_set_header($name = NULL, $value = NULL, $append = FALSE) {
* A string containing the header value, or FALSE if the header has been set,
* or NULL if the header has not been set.
*/
-function drupal_get_header($name = NULL) {
- $headers = drupal_set_header();
+function drupal_get_http_header($name = NULL) {
+ $headers = drupal_add_http_header();
if (isset($name)) {
$name = strtolower($name);
return isset($headers[$name]) ? $headers[$name] : NULL;
@@ -910,9 +910,9 @@ function _drupal_set_preferred_header_name($name = NULL) {
}
/**
- * Send the HTTP response headers previously set using drupal_set_header().
+ * Send the HTTP response headers previously set using drupal_add_http_header().
* Add default headers, unless they have been replaced or unset using
- * drupal_set_header().
+ * drupal_add_http_header().
*
* @param $default_headers
* An array of headers as name/value pairs.
@@ -921,7 +921,7 @@ function _drupal_set_preferred_header_name($name = NULL) {
*/
function drupal_send_headers($default_headers = array(), $only_default = FALSE) {
$headers_sent = &drupal_static(__FUNCTION__, FALSE);
- $headers = drupal_get_header();
+ $headers = drupal_get_http_header();
if ($only_default && $headers_sent) {
$headers = array();
}
@@ -994,7 +994,7 @@ function drupal_page_header() {
*
* The headers allow as much as possible in proxies and browsers without any
* particular knowledge about the pages. Modules can override these headers
- * using drupal_set_header().
+ * using drupal_add_http_header().
*
* If the request is conditional (using If-Modified-Since and If-None-Match),
* and the conditions match those currently in the cache, a 304 Not Modified
@@ -1006,10 +1006,10 @@ function drupal_serve_page_from_cache(stdClass $cache) {
$return_compressed = $page_compression && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE;
// Get headers set in hook_boot(). Keys are lower-case.
- $hook_boot_headers = drupal_get_header();
+ $hook_boot_headers = drupal_get_http_header();
// Headers generated in this function, that may be replaced or unset using
- // drupal_set_headers(). Keys are mixed-case.
+ // drupal_add_http_headers(). Keys are mixed-case.
$default_headers = array();
foreach ($cache->headers as $name => $value) {
@@ -1018,7 +1018,7 @@ function drupal_serve_page_from_cache(stdClass $cache) {
// headers set in hook_boot().
$name_lower = strtolower($name);
if (in_array($name_lower, array('content-location', 'expires', 'cache-control', 'vary')) && !isset($hook_boot_headers[$name_lower])) {
- drupal_set_header($name, $value);
+ drupal_add_http_header($name, $value);
unset($cache->headers[$name]);
}
}
@@ -1050,7 +1050,7 @@ function drupal_serve_page_from_cache(stdClass $cache) {
// Send the remaining headers.
foreach ($cache->headers as $name => $value) {
- drupal_set_header($name, $value);
+ drupal_add_http_header($name, $value);
}
$default_headers['Last-Modified'] = gmdate(DATE_RFC1123, $cache->created);
diff --git a/includes/common.inc b/includes/common.inc
index 2b98b3b7a..ec5d34cda 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -645,7 +645,7 @@ function drupal_goto($path = '', array $query = array(), $fragment = NULL, $http
*/
function drupal_site_offline() {
drupal_maintenance_theme();
- drupal_set_header('503 Service unavailable');
+ drupal_add_http_header('503 Service unavailable');
drupal_set_title(t('Site under maintenance'));
print theme('maintenance_page', filter_xss_admin(variable_get('maintenance_mode_message',
t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))));
@@ -655,7 +655,7 @@ function drupal_site_offline() {
* Generates a 404 error if the request can not be handled.
*/
function drupal_not_found() {
- drupal_set_header('404 Not Found');
+ drupal_add_http_header('404 Not Found');
watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
@@ -687,7 +687,7 @@ function drupal_not_found() {
* Generates a 403 error if the request is not allowed.
*/
function drupal_access_denied() {
- drupal_set_header('403 Forbidden');
+ drupal_add_http_header('403 Forbidden');
watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
// Keep old path for reference, and to allow forms to redirect to it.
@@ -1139,7 +1139,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
}
if ($fatal) {
- drupal_set_header('500 Service unavailable (with message)');
+ drupal_add_http_header('500 Service unavailable (with message)');
}
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
@@ -3411,7 +3411,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
* callback function and each value an array of arguments. For example:
*
* @code
- * $build['#attached']['drupal_set_header'] = array(
+ * $build['#attached']['drupal_add_http_header'] = array(
* array('Content-Type', 'application/rss+xml; charset=utf-8'),
* );
* @endcode
@@ -3789,7 +3789,7 @@ function drupal_json_encode($var) {
*/
function drupal_json_output($var = NULL) {
// We are returning JavaScript, so tell the browser.
- drupal_set_header('Content-Type', 'text/javascript; charset=utf-8');
+ drupal_add_http_header('Content-Type', 'text/javascript; charset=utf-8');
if (isset($var)) {
echo drupal_json_encode($var);
@@ -3902,7 +3902,7 @@ function _drupal_bootstrap_full() {
set_exception_handler('_drupal_exception_handler');
// Emit the correct charset HTTP header.
- drupal_set_header('Content-Type', 'text/html; charset=utf-8');
+ drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
// Detect string handling method
unicode_check();
// Undo magic quotes
@@ -3957,9 +3957,9 @@ function drupal_page_set_cache() {
);
// Restore preferred header names based on the lower-case names returned
- // by drupal_get_header().
+ // by drupal_get_http_header().
$header_names = _drupal_set_preferred_header_name();
- foreach (drupal_get_header() as $name_lower => $value) {
+ foreach (drupal_get_http_header() as $name_lower => $value) {
$cache->headers[$header_names[$name_lower]] = $value;
}
diff --git a/includes/database/database.inc b/includes/database/database.inc
index b20de3979..4b51b8b9b 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -2381,7 +2381,7 @@ function _db_error_page($error = '') {
global $db_type;
drupal_language_initialize();
drupal_maintenance_theme();
- drupal_set_header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable');
+ drupal_add_http_header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable');
drupal_set_title('Site offline');
}
diff --git a/includes/file.inc b/includes/file.inc
index 894f90bc3..0a69859ec 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -1502,7 +1502,7 @@ function file_transfer($uri, $headers) {
}
foreach ($headers as $name => $value) {
- drupal_set_header($name, $value);
+ drupal_add_http_header($name, $value);
}
drupal_send_headers();
$scheme = file_uri_scheme($uri);
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index 701908639..1695acef3 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -119,7 +119,7 @@ function theme_task_list($items, $active = NULL) {
* The page content to show.
*/
function theme_install_page($content) {
- drupal_set_header('Content-Type', 'text/html; charset=utf-8');
+ drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
// Assign content.
$variables['content'] = $content;
@@ -176,7 +176,7 @@ function theme_install_page($content) {
*/
function theme_update_page($content, $show_messages = TRUE) {
// Set required headers.
- drupal_set_header('Content-Type', 'text/html; charset=utf-8');
+ drupal_add_http_header('Content-Type', 'text/html; charset=utf-8');
// Assign content and show message flag.
$variables['content'] = $content;
diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc
index 76ccd8895..cf378f4fc 100644
--- a/includes/xmlrpcs.inc
+++ b/includes/xmlrpcs.inc
@@ -106,8 +106,8 @@ function xmlrpc_server_error($error, $message = FALSE) {
function xmlrpc_server_output($xml) {
$xml = '<?xml version="1.0"?>' . "\n" . $xml;
- drupal_set_header('Content-Length', strlen($xml));
- drupal_set_header('Content-Type', 'text/xml');
+ drupal_add_http_header('Content-Length', strlen($xml));
+ drupal_add_http_header('Content-Type', 'text/xml');
echo $xml;
exit;
}