Ticket #25451: 25451.patch
File 25451.patch, 1.9 KB (added by , 10 years ago) |
---|
-
src/wp-includes/functions.php
894 894 * Set HTTP status header. 895 895 * 896 896 * @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. 897 * @see get_status_header_desc() 900 898 * 901 * @param int $header HTTP status code 902 * @return unknown 899 * @param int $code HTTP status code. 903 900 */ 904 function status_header( $ header) {905 $ text = get_status_header_desc( $header);901 function status_header( $code ) { 902 $description = get_status_header_desc( $code ); 906 903 907 if ( empty( $ text) )908 return false;904 if ( empty( $description ) ) 905 return; 909 906 910 $protocol = $_SERVER[ "SERVER_PROTOCOL"];907 $protocol = $_SERVER['SERVER_PROTOCOL']; 911 908 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) 912 909 $protocol = 'HTTP/1.0'; 913 $status_header = "$protocol $ header $text";910 $status_header = "$protocol $code $description"; 914 911 if ( function_exists( 'apply_filters' ) ) 915 $status_header = apply_filters( 'status_header', $status_header, $ header, $text, $protocol );912 $status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol ); 916 913 917 return @header( $status_header, true, $header);914 @header( $status_header, true, $code ); 918 915 } 919 916 920 917 /** … … 925 922 * 926 923 * @since 2.8.0 927 924 * 928 * @uses apply_filters()929 925 * @return array The associative array of header names and field values. 930 926 */ 931 927 function wp_get_nocache_headers() { … … 949 945 * be sent so that all of them get the point that no caching should occur. 950 946 * 951 947 * @since 2.0.0 952 * @ useswp_get_nocache_headers()948 * @see wp_get_nocache_headers() 953 949 */ 954 950 function nocache_headers() { 955 951 $headers = wp_get_nocache_headers();