Make WordPress Core


Ignore:
Timestamp:
10/29/2013 10:43:08 PM (11 years ago)
Author:
SergeyBiryukov
Message:

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

props tivnet for initial patch.
fixes #25451.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r25827 r25990  
    895895 *
    896896 * @since 2.0.0
    897  * @uses apply_filters() Calls 'status_header' on status header string, HTTP
    898  *      HTTP code, HTTP code description, and protocol string as separate
    899  *      parameters.
    900  *
    901  * @param int $header HTTP status code
    902  * @return unknown
    903  */
    904 function status_header( $header ) {
    905     $text = get_status_header_desc( $header );
    906 
    907     if ( empty( $text ) )
    908         return false;
    909 
    910     $protocol = $_SERVER["SERVER_PROTOCOL"];
     897 * @see get_status_header_desc()
     898 *
     899 * @param int $code HTTP status code.
     900 */
     901function status_header( $code ) {
     902    $description = get_status_header_desc( $code );
     903
     904    if ( empty( $description ) )
     905        return;
     906
     907    $protocol = $_SERVER['SERVER_PROTOCOL'];
    911908    if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
    912909        $protocol = 'HTTP/1.0';
    913     $status_header = "$protocol $header $text";
     910    $status_header = "$protocol $code $description";
    914911    if ( function_exists( 'apply_filters' ) )
    915         $status_header = apply_filters( 'status_header', $status_header, $header, $text, $protocol );
    916 
    917     return @header( $status_header, true, $header );
     912        $status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol );
     913
     914    @header( $status_header, true, $code );
    918915}
    919916
     
    926923 * @since 2.8.0
    927924 *
    928  * @uses apply_filters()
    929925 * @return array The associative array of header names and field values.
    930926 */
     
    950946 *
    951947 * @since 2.0.0
    952  * @uses wp_get_nocache_headers()
     948 * @see wp_get_nocache_headers()
    953949 */
    954950function nocache_headers() {
Note: See TracChangeset for help on using the changeset viewer.