diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-09-30 18:36:02 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-09-30 18:36:02 +0000 |
commit | 7178f6b17398b10105f8246b11c8d10b14ae39a6 (patch) | |
tree | ce4bc701c146ae17f4e38190565c4839c22956ff /modules | |
parent | a8f8a26f6d77f6aca8821e28e66ea253687d7d59 (diff) | |
download | brdo-7178f6b17398b10105f8246b11c8d10b14ae39a6.tar.gz brdo-7178f6b17398b10105f8246b11c8d10b14ae39a6.tar.bz2 |
- Patch #451604 by brianV, sun | Dries, c960657: rename drupal_set_header().
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator/aggregator.pages.inc | 4 | ||||
-rw-r--r-- | modules/aggregator/tests/aggregator_test.module | 12 | ||||
-rw-r--r-- | modules/image/image.module | 6 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/openid/tests/openid_test.module | 8 | ||||
-rw-r--r-- | modules/simpletest/tests/browser_test.module | 4 | ||||
-rw-r--r-- | modules/simpletest/tests/system_test.module | 2 | ||||
-rw-r--r-- | modules/system/system.module | 4 |
8 files changed, 20 insertions, 22 deletions
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc index 7a816a59f..b34787f93 100644 --- a/modules/aggregator/aggregator.pages.inc +++ b/modules/aggregator/aggregator.pages.inc @@ -369,7 +369,7 @@ function aggregator_page_rss() { * @ingroup themeable */ function theme_aggregator_page_rss($feeds, $category = NULL) { - drupal_set_header('Content-Type', 'application/rss+xml; charset=utf-8'); + drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8'); $items = ''; $feed_length = variable_get('feed_item_length', 'fulltext'); @@ -429,7 +429,7 @@ function aggregator_page_opml($cid = NULL) { * @ingroup themeable */ function theme_aggregator_page_opml($feeds) { - drupal_set_header('Content-Type', 'text/xml; charset=utf-8'); + drupal_add_http_header('Content-Type', 'text/xml; charset=utf-8'); $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; $output .= "<opml version=\"1.1\">\n"; diff --git a/modules/aggregator/tests/aggregator_test.module b/modules/aggregator/tests/aggregator_test.module index 6596ec496..a13c47208 100644 --- a/modules/aggregator/tests/aggregator_test.module +++ b/modules/aggregator/tests/aggregator_test.module @@ -33,21 +33,21 @@ function aggregator_test_feed($use_last_modified = FALSE, $use_etag = FALSE) { // Send appropriate response. We respond with a 304 not modified on either // etag or on last modified. if ($use_last_modified) { - drupal_set_header('Last-Modified', gmdate(DATE_RFC1123, $last_modified)); + drupal_add_http_header('Last-Modified', gmdate(DATE_RFC1123, $last_modified)); } if ($use_etag) { - drupal_set_header('ETag', $etag); + drupal_add_http_header('ETag', $etag); } // Return 304 not modified if either last modified or etag match. if ($last_modified == $if_modified_since || $etag == $if_none_match) { - drupal_set_header('304 Not Modified'); + drupal_add_http_header('304 Not Modified'); return; } // The following headers force validation of cache: - drupal_set_header('Expires', 'Sun, 19 Nov 1978 05:00:00 GMT'); - drupal_set_header('Cache-Control', 'must-revalidate'); - drupal_set_header('Content-Type', 'application/rss+xml; charset=utf-8'); + drupal_add_http_header('Expires', 'Sun, 19 Nov 1978 05:00:00 GMT'); + drupal_add_http_header('Cache-Control', 'must-revalidate'); + drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8'); // Read actual feed from file. $file_name = DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/tests/aggregator_test_rss091.xml'; diff --git a/modules/image/image.module b/modules/image/image.module index 3e43ed5f5..603c336b1 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -453,8 +453,8 @@ function image_style_generate() { if (!$lock_acquired) { // Tell client to retry again in 3 seconds. Currently no browsers are known // to support Retry-After. - drupal_set_header('503 Service Unavailable'); - drupal_set_header('Retry-After', 3); + drupal_add_http_header('503 Service Unavailable'); + drupal_add_http_header('Retry-After', 3); print t('Image generation in progress, please try again shortly.'); exit(); } @@ -474,7 +474,7 @@ function image_style_generate() { } else { watchdog('image', 'Unable to generate the derived image located at %path.', $destination); - drupal_set_header('500 Internal Server Error'); + drupal_add_http_header('500 Internal Server Error'); print t('Error generating image.'); exit(); } diff --git a/modules/node/node.module b/modules/node/node.module index b826cc4e4..bf5f76179 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1908,7 +1908,7 @@ function node_feed($nids = FALSE, $channel = array()) { $output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']); $output .= "</rss>\n"; - drupal_set_header('Content-Type', 'application/rss+xml; charset=utf-8'); + drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8'); print $output; } diff --git a/modules/openid/tests/openid_test.module b/modules/openid/tests/openid_test.module index 6fb503c43..325e67d01 100644 --- a/modules/openid/tests/openid_test.module +++ b/modules/openid/tests/openid_test.module @@ -69,7 +69,7 @@ function openid_test_menu() { */ function openid_test_yadis_xrds() { if ($_SERVER['HTTP_ACCEPT'] == 'application/xrds+xml') { - drupal_set_header('Content-Type', 'application/xrds+xml'); + drupal_add_http_header('Content-Type', 'application/xrds+xml'); print '<?xml version="1.0" encoding="UTF-8"?> <xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)"> <XRD> @@ -89,7 +89,7 @@ function openid_test_yadis_xrds() { * Menu callback; regular HTML page with an X-XRDS-Location HTTP header. */ function openid_test_yadis_x_xrds_location() { - drupal_set_header('X-XRDS-Location', url('openid-test/yadis/xrds', array('absolute' => TRUE))); + drupal_add_http_header('X-XRDS-Location', url('openid-test/yadis/xrds', array('absolute' => TRUE))); return t('This page includes an X-RDS-Location HTTP header containing the URL of an XRDS document.'); } @@ -181,7 +181,7 @@ function _openid_test_endpoint_associate() { // Respond to Relying Party in the special Key-Value Form Encoding (see OpenID // Authentication 1.0, section 4.1.1). - drupal_set_header('Content-Type', 'text/plain'); + drupal_add_http_header('Content-Type', 'text/plain'); print _openid_create_message($response); } @@ -228,6 +228,6 @@ function _openid_test_endpoint_authenticate() { // Put the signed message into the query string of a URL supplied by the // Relying Party, and redirect the user. - drupal_set_header('Content-Type', 'text/plain'); + drupal_add_http_header('Content-Type', 'text/plain'); header('Location: ' . url($_REQUEST['openid_return_to'], array('query' => $response, 'external' => TRUE))); } diff --git a/modules/simpletest/tests/browser_test.module b/modules/simpletest/tests/browser_test.module index cf107d850..7fee6666a 100644 --- a/modules/simpletest/tests/browser_test.module +++ b/modules/simpletest/tests/browser_test.module @@ -10,8 +10,6 @@ * Implement hook_menu(). */ function browser_test_menu() { - $items = array(); - $items['browser_test/print/get'] = array( 'page callback' => 'browser_test_print_get', 'access arguments' => array('access content'), @@ -69,7 +67,7 @@ function browser_test_refresh_meta() { function browser_test_refresh_header() { if (!isset($_GET['refresh'])) { $url = url('browser_test/refresh/header', array('absolute' => TRUE, 'query' => array('refresh' => 'true'))); - drupal_set_header('Location', $url); + drupal_add_http_header('Location', $url); return ''; } echo 'Refresh successful'; diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module index 73f5fbfb3..192e3f4f0 100644 --- a/modules/simpletest/tests/system_test.module +++ b/modules/simpletest/tests/system_test.module @@ -96,7 +96,7 @@ function system_test_redirect($code) { } function system_test_set_header() { - drupal_set_header($_GET['name'], $_GET['value']); + drupal_add_http_header($_GET['name'], $_GET['value']); return t('The following header was set: %name: %value', array('%name' => $_GET['name'], '%value' => $_GET['value'])); } diff --git a/modules/system/system.module b/modules/system/system.module index 688eeca83..6a5d8187c 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2730,7 +2730,7 @@ function theme_meta_generator_html($version = VERSION) { * @ingroup themeable */ function theme_meta_generator_header($version = VERSION) { - drupal_set_header('X-Generator', 'Drupal ' . $version . ' (http://drupal.org)'); + drupal_add_http_header('X-Generator', 'Drupal ' . $version . ' (http://drupal.org)'); } /** @@ -2824,7 +2824,7 @@ function system_run_cron_image() { // Output a transparent 1x1 image to the browser; required for clients not // supporting JavaScript. - drupal_set_header('Content-Type', 'image/gif'); + drupal_add_http_header('Content-Type', 'image/gif'); echo "\x47\x49\x46\x38\x39\x61\x1\x0\x1\x0\x80\xff\x0\xc0\xc0\xc0\x0\x0\x0\x21\xf9\x4\x1\x0\x0\x0\x0\x2c\x0\x0\x0\x0\x1\x0\x1\x0\x0\x2\x2\x44\x1\x0\x3b"; // Cron threshold semaphore is used to avoid errors every time the image |