drupal_set_header
includes/common.inc, строка 133
- Версии
- 5 – 6
drupal_set_header($header = NULL)
Set an HTTP response header for the current page.
Note: when sending a Content-Type header, always include a 'charset'
type
too. This is necessary to avoid security bugs (e.g. UTF-7 XSS).
Код
<?php
function drupal_set_header($header = NULL) {
// We use an array to guarantee there are no leading or trailing delimiters.
// Otherwise, header('') could get called when serving the page later, which
// ends HTTP headers prematurely on some PHP versions.
static $stored_headers = array();
if (strlen($header)) {
header($header);
$stored_headers[] = $header;
}
return implode("\n", $stored_headers);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии