Remove incorrect @return value from status_header(). Rename some variables for clarity.

props tivnet for initial patch.
fixes #25451.

git-svn-id: https://develop.svn.wordpress.org/trunk@25990 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-10-29 22:43:08 +00:00
parent 23ad7058fb
commit a1fe0926b3

View File

@ -894,27 +894,24 @@ function get_status_header_desc( $code ) {
* Set HTTP status header. * Set HTTP status header.
* *
* @since 2.0.0 * @since 2.0.0
* @uses apply_filters() Calls 'status_header' on status header string, HTTP * @see get_status_header_desc()
* HTTP code, HTTP code description, and protocol string as separate
* parameters.
* *
* @param int $header HTTP status code * @param int $code HTTP status code.
* @return unknown
*/ */
function status_header( $header ) { function status_header( $code ) {
$text = get_status_header_desc( $header ); $description = get_status_header_desc( $code );
if ( empty( $text ) ) if ( empty( $description ) )
return false; return;
$protocol = $_SERVER["SERVER_PROTOCOL"]; $protocol = $_SERVER['SERVER_PROTOCOL'];
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
$protocol = 'HTTP/1.0'; $protocol = 'HTTP/1.0';
$status_header = "$protocol $header $text"; $status_header = "$protocol $code $description";
if ( function_exists( 'apply_filters' ) ) if ( function_exists( 'apply_filters' ) )
$status_header = apply_filters( 'status_header', $status_header, $header, $text, $protocol ); $status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol );
return @header( $status_header, true, $header ); @header( $status_header, true, $code );
} }
/** /**
@ -925,7 +922,6 @@ function status_header( $header ) {
* *
* @since 2.8.0 * @since 2.8.0
* *
* @uses apply_filters()
* @return array The associative array of header names and field values. * @return array The associative array of header names and field values.
*/ */
function wp_get_nocache_headers() { function wp_get_nocache_headers() {
@ -949,7 +945,7 @@ function wp_get_nocache_headers() {
* be sent so that all of them get the point that no caching should occur. * be sent so that all of them get the point that no caching should occur.
* *
* @since 2.0.0 * @since 2.0.0
* @uses wp_get_nocache_headers() * @see wp_get_nocache_headers()
*/ */
function nocache_headers() { function nocache_headers() {
$headers = wp_get_nocache_headers(); $headers = wp_get_nocache_headers();