Ticket #21282: 21273.diff
File 21273.diff, 39.8 KB (added by , 12 years ago) |
---|
-
wp-includes/pluggable.php
878 878 if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' ) 879 879 status_header($status); // This causes problems on IIS and some FastCGI setups 880 880 881 header("Location: $location", true, $status);881 wp_header( "Location: $location", true, $status ); 882 882 } 883 883 endif; 884 884 … … 1737 1737 return $r; 1738 1738 } 1739 1739 endif; 1740 1741 if ( !function_exists( 'wp_header' ) ) : 1742 /** 1743 * Sends HTTP Header to the client 1744 * 1745 * @since 3.5 1746 * 1747 * @param string $header The header string. 1748 * @param boolean $replace True if header should replace previous header, false if not. Default is true. 1749 * @param int $http_response_code Force the HTTP response code to given value if provided. Default is null. 1750 */ 1751 function wp_header( $header, $replace = true, $http_response_code = null ) { 1752 if ( !empty( $http_response_code ) ) 1753 @header( $header, $replace, (int) $http_response_code ); 1754 else 1755 @header( $header, $replace ); 1756 } 1757 endif; -
wp-trackback.php
17 17 * @param string $error_message Error message if an error occurred 18 18 */ 19 19 function trackback_response($error = 0, $error_message = '') { 20 header('Content-Type: text/xml; charset=' . get_option('blog_charset') );20 wp_header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) ); 21 21 if ($error) { 22 22 echo '<?xml version="1.0" encoding="utf-8"?'.">\n"; 23 23 echo "<response>\n"; … … 82 82 } 83 83 84 84 if ( !empty($tb_url) && !empty($title) ) { 85 header('Content-Type: text/xml; charset=' . get_option('blog_charset') );85 wp_header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ) ); 86 86 87 87 if ( !pings_open($tb_id) ) 88 88 trackback_response(1, 'Sorry, trackbacks are closed for this item.'); -
wp-admin/network/sites.php
202 202 check_admin_referer( 'confirm' ); 203 203 if ( !headers_sent() ) { 204 204 nocache_headers(); 205 header( 'Content-Type: text/html; charset=utf-8' );205 wp_header( 'Content-Type: text/html; charset=utf-8' ); 206 206 } 207 207 if ( $current_site->blog_id == $id ) 208 208 wp_die( __( 'You are not allowed to change the current site.' ) ); -
wp-admin/admin-header.php
6 6 * @subpackage Administration 7 7 */ 8 8 9 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));9 wp_header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 10 10 if ( ! defined( 'WP_ADMIN' ) ) 11 11 require_once( './admin.php' ); 12 12 -
wp-admin/upgrade.php
43 43 else 44 44 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ); 45 45 46 @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );46 wp_header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 47 47 ?> 48 48 <!DOCTYPE html> 49 49 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> -
wp-admin/press-this.php
11 11 /** WordPress Administration Bootstrap */ 12 12 require_once('./admin.php'); 13 13 14 header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));14 wp_header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 15 15 16 16 if ( ! current_user_can('edit_posts') ) 17 17 wp_die( __( 'Cheatin’ uh?' ) ); -
wp-admin/setup-config.php
86 86 function display_header() { 87 87 global $wp_version; 88 88 89 header( 'Content-Type: text/html; charset=utf-8' );89 wp_header( 'Content-Type: text/html; charset=utf-8' ); 90 90 ?> 91 91 <!DOCTYPE html> 92 92 <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>> -
wp-admin/install.php
51 51 * @subpackage Installer 52 52 */ 53 53 function display_header() { 54 header( 'Content-Type: text/html; charset=utf-8' );54 wp_header( 'Content-Type: text/html; charset=utf-8' ); 55 55 ?> 56 56 <!DOCTYPE html> 57 57 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> -
wp-admin/async-upload.php
23 23 unset($current_user); 24 24 require_once('./admin.php'); 25 25 26 header('Content-Type: text/html; charset=' . get_option('blog_charset'));26 wp_header('Content-Type: text/html; charset=' . get_option('blog_charset')); 27 27 28 28 if ( !current_user_can('upload_files') ) 29 29 wp_die(__('You do not have permission to upload files.')); -
wp-admin/load-styles.php
132 132 } 133 133 } 134 134 135 header('Content-Type: text/css');136 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');137 header("Cache-Control: public, max-age=$expires_offset");135 wp_header( 'Content-Type: text/css' ); 136 wp_header( 'Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT' ); 137 wp_header( "Cache-Control: public, max-age=$expires_offset" ); 138 138 139 139 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { 140 header('Vary: Accept-Encoding'); // Handle proxies140 wp_header( 'Vary: Accept-Encoding' ); // Handle proxies 141 141 if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { 142 header('Content-Encoding: deflate');142 wp_header( 'Content-Encoding: deflate' ); 143 143 $out = gzdeflate( $out, 3 ); 144 144 } elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) { 145 header('Content-Encoding: gzip');145 wp_header( 'Content-Encoding: gzip' ); 146 146 $out = gzencode( $out, 3 ); 147 147 } 148 148 } -
wp-admin/load-scripts.php
139 139 $out .= get_file($path) . "\n"; 140 140 } 141 141 142 header('Content-Type: application/x-javascript; charset=UTF-8');143 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');144 header("Cache-Control: public, max-age=$expires_offset");142 wp_header( 'Content-Type: application/x-javascript; charset=UTF-8' ); 143 wp_header( 'Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT' ); 144 wp_header( "Cache-Control: public, max-age=$expires_offset" ); 145 145 146 146 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { 147 header('Vary: Accept-Encoding'); // Handle proxies147 wp_header( 'Vary: Accept-Encoding' ); // Handle proxies 148 148 if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { 149 header('Content-Encoding: deflate');149 wp_header( 'Content-Encoding: deflate' ); 150 150 $out = gzdeflate( $out, 3 ); 151 151 } elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) { 152 header('Content-Encoding: gzip');152 wp_header( 'Content-Encoding: gzip' ); 153 153 $out = gzencode( $out, 3 ); 154 154 } 155 155 } -
wp-admin/maint/repair.php
9 9 10 10 require_once('../../wp-load.php'); 11 11 12 header( 'Content-Type: text/html; charset=utf-8' );12 wp_header( 'Content-Type: text/html; charset=utf-8' ); 13 13 ?> 14 14 <!DOCTYPE html> 15 15 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> -
wp-admin/admin-ajax.php
29 29 /** Load Ajax Handlers for WordPress Core */ 30 30 require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' ); 31 31 32 @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );33 @header( 'X-Robots-Tag: noindex' );32 wp_header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); 33 wp_header( 'X-Robots-Tag: noindex' ); 34 34 35 35 send_nosniff_header(); 36 36 -
wp-admin/includes/image-edit.php
202 202 203 203 switch ( $mime_type ) { 204 204 case 'image/jpeg': 205 header('Content-Type: image/jpeg');205 wp_header( 'Content-Type: image/jpeg' ); 206 206 return imagejpeg($image, null, 90); 207 207 case 'image/png': 208 header('Content-Type: image/png');208 wp_header( 'Content-Type: image/png' ); 209 209 return imagepng($image); 210 210 case 'image/gif': 211 header('Content-Type: image/gif');211 wp_header( 'Content-Type: image/gif' ); 212 212 return imagegif($image); 213 213 default: 214 214 return false; -
wp-admin/includes/export.php
36 36 if ( ! empty($sitename) ) $sitename .= '.'; 37 37 $filename = $sitename . 'wordpress.' . date( 'Y-m-d' ) . '.xml'; 38 38 39 header( 'Content-Description: File Transfer' );40 header( 'Content-Disposition: attachment; filename=' . $filename );41 header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true );39 wp_header( 'Content-Description: File Transfer' ); 40 wp_header( 'Content-Disposition: attachment; filename=' . $filename ); 41 wp_header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); 42 42 43 43 if ( 'all' != $args['content'] && post_type_exists( $args['content'] ) ) { 44 44 $ptype = get_post_type_object( $args['content'] ); -
wp-admin/includes/ajax-actions.php
93 93 } 94 94 95 95 if ( isset($_GET['test']) ) { 96 header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );97 header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );98 header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );99 header( 'Pragma: no-cache' );100 header('Content-Type: application/x-javascript; charset=UTF-8');96 wp_header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' ); 97 wp_header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); 98 wp_header( 'Cache-Control: no-cache, must-revalidate, max-age=0' ); 99 wp_header( 'Pragma: no-cache' ); 100 wp_header( 'Content-Type: application/x-javascript; charset=UTF-8' ); 101 101 $force_gzip = ( defined('ENFORCE_GZIP') && ENFORCE_GZIP ); 102 102 $test_str = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."'; 103 103 … … 108 108 if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) 109 109 wp_die( -1 ); 110 110 if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { 111 header('Content-Encoding: deflate');111 wp_header( 'Content-Encoding: deflate' ); 112 112 $out = gzdeflate( $test_str, 1 ); 113 113 } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) { 114 header('Content-Encoding: gzip');114 wp_header( 'Content-Encoding: gzip' ); 115 115 $out = gzencode( $test_str, 1 ); 116 116 } else { 117 117 wp_die( -1 ); -
wp-admin/customize.php
39 39 do_action( 'customize_controls_enqueue_scripts' ); 40 40 41 41 // Let's roll. 42 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));42 wp_header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 43 43 44 44 wp_user_settings(); 45 45 _wp_admin_html_begin(); -
wp-admin/media-upload.php
24 24 wp_enqueue_style('imgareaselect'); 25 25 wp_enqueue_script( 'media-gallery' ); 26 26 27 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));27 wp_header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 28 28 29 29 // IDs should be integers 30 30 $ID = isset($ID) ? (int) $ID : 0; -
wp-includes/class-wp.php
377 377 if ( ! empty( $status ) ) 378 378 status_header( $status ); 379 379 foreach( (array) $headers as $name => $field_value ) 380 @header("{$name}: {$field_value}");380 wp_header( "{$name}: {$field_value}" ); 381 381 382 382 if ( $exit_required ) 383 383 exit(); -
wp-includes/class-IXR.php
369 369 { 370 370 if (!$data) { 371 371 if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') { 372 header('Content-Type: text/plain'); // merged from WP #9093372 wp_header( 'Content-Type: text/plain' ); // merged from WP #9093 373 373 die('XML-RPC server accepts POST requests only.'); 374 374 } 375 375 … … 468 468 { 469 469 $xml = '<?xml version="1.0"?>'."\n".$xml; 470 470 $length = strlen($xml); 471 header('Connection: close');472 header('Content-Length: '.$length);473 header('Content-Type: text/xml');474 header('Date: '.date('r'));471 wp_header( 'Connection: close' ); 472 wp_header( 'Content-Length: '.$length ); 473 wp_header( 'Content-Type: text/xml' ); 474 wp_header( 'Date: '.date( 'r' ) ); 475 475 echo $xml; 476 476 exit; 477 477 } -
wp-includes/functions.php
866 866 * parameters. 867 867 * 868 868 * @param int $header HTTP status code 869 * @return unknown870 869 */ 871 870 function status_header( $header ) { 872 871 $text = get_status_header_desc( $header ); … … 881 880 if ( function_exists( 'apply_filters' ) ) 882 881 $status_header = apply_filters( 'status_header', $status_header, $header, $text, $protocol ); 883 882 884 return @header( $status_header, true, $header );883 wp_header( $status_header, true, $header ); 885 884 } 886 885 887 886 /** … … 921 920 function nocache_headers() { 922 921 $headers = wp_get_nocache_headers(); 923 922 foreach( $headers as $name => $field_value ) 924 @header("{$name}: {$field_value}");923 wp_header( "{$name}: {$field_value}" ); 925 924 } 926 925 927 926 /** … … 931 930 */ 932 931 function cache_javascript_headers() { 933 932 $expiresOffset = 864000; // 10 days 934 header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) );935 header( "Vary: Accept-Encoding" ); // Handle proxies936 header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . " GMT" );933 wp_header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); 934 wp_header( "Vary: Accept-Encoding" ); // Handle proxies 935 wp_header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $expiresOffset ) . " GMT" ); 937 936 } 938 937 939 938 /** … … 1048 1047 * @uses do_action() Calls 'do_robotstxt' hook for displaying robots.txt rules. 1049 1048 */ 1050 1049 function do_robots() { 1051 header( 'Content-Type: text/plain; charset=utf-8' );1050 wp_header( 'Content-Type: text/plain; charset=utf-8' ); 1052 1051 1053 1052 do_action( 'do_robotstxt' ); 1054 1053 … … 1937 1936 if ( !headers_sent() ) { 1938 1937 status_header( $r['response'] ); 1939 1938 nocache_headers(); 1940 header( 'Content-Type: text/html; charset=utf-8' );1939 wp_header( 'Content-Type: text/html; charset=utf-8' ); 1941 1940 } 1942 1941 1943 1942 if ( empty($title) ) … … 2510 2509 // Otherwise, be terse. 2511 2510 status_header( 500 ); 2512 2511 nocache_headers(); 2513 header( 'Content-Type: text/html; charset=utf-8' );2512 wp_header( 'Content-Type: text/html; charset=utf-8' ); 2514 2513 2515 2514 wp_load_translations_early(); 2516 2515 ?> … … 3391 3390 * @return none 3392 3391 */ 3393 3392 function send_nosniff_header() { 3394 @header( 'X-Content-Type-Options: nosniff' );3393 wp_header( 'X-Content-Type-Options: nosniff' ); 3395 3394 } 3396 3395 3397 3396 /** … … 3493 3492 * @return none 3494 3493 */ 3495 3494 function send_frame_options_header() { 3496 @header( 'X-Frame-Options: SAMEORIGIN' );3495 wp_header( 'X-Frame-Options: SAMEORIGIN' ); 3497 3496 } 3498 3497 3499 3498 /** -
wp-includes/class-json.php
236 236 */ 237 237 function encode($var) 238 238 { 239 header('Content-type: application/json');239 wp_header( 'Content-type: application/json' ); 240 240 return $this->_encode($var); 241 241 } 242 242 /** -
wp-includes/http.php
294 294 if ( ! is_allowed_http_origin( $origin ) ) 295 295 return false; 296 296 297 @header( 'Access-Control-Allow-Origin: ' . $origin );298 @header( 'Access-Control-Allow-Credentials: true' );297 wp_header( 'Access-Control-Allow-Origin: ' . $origin ); 298 wp_header( 'Access-Control-Allow-Credentials: true' ); 299 299 300 300 return $origin; 301 301 } 302 Brak znaku nowej linii na końcu pliku -
wp-includes/feed-rss.php
5 5 * @package WordPress 6 6 */ 7 7 8 header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);8 wp_header( 'Content-Type: ' . feed_content_type( 'rss-http' ) . '; charset=' . get_option( 'blog_charset' ), true ); 9 9 $more = 1; 10 10 11 11 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> -
wp-includes/vars.php
53 53 } elseif ( stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false ) { 54 54 if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) !== false ) { 55 55 if ( $is_chrome = apply_filters( 'use_google_chrome_frame', is_admin() ) ) 56 header( 'X-UA-Compatible: chrome=1' );56 wp_header( 'X-UA-Compatible: chrome=1' ); 57 57 $is_winIE = ! $is_chrome; 58 58 } else { 59 59 $is_chrome = true; -
wp-includes/feed-rdf.php
5 5 * @package WordPress 6 6 */ 7 7 8 header('Content-Type: ' . feed_content_type('rdf') . '; charset=' . get_option('blog_charset'), true);8 wp_header( 'Content-Type: ' . feed_content_type( 'rdf' ) . '; charset=' . get_option( 'blog_charset' ), true ); 9 9 $more = 1; 10 10 11 11 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> -
wp-includes/ms-settings.php
88 88 } else { 89 89 $destination = 'http://' . $current_site->domain . $current_site->path . 'wp-signup.php?new=' . str_replace( '.' . $current_site->domain, '', $domain ); 90 90 } 91 header( 'Location: ' . $destination );91 wp_header( 'Location: ' . $destination ); 92 92 die(); 93 93 } 94 94 95 95 if ( ! defined( 'WP_INSTALLING' ) ) { 96 96 if ( $current_site && ! $current_blog ) { 97 97 if ( $current_site->domain != $_SERVER[ 'HTTP_HOST' ] ) { 98 header( 'Location: http://' . $current_site->domain . $current_site->path );98 wp_header( 'Location: http://' . $current_site->domain . $current_site->path ); 99 99 exit; 100 100 } 101 101 $current_blog = get_blog_details( array( 'domain' => $current_site->domain, 'path' => $current_site->path ), false ); -
wp-includes/class-wp-ajax-response.php
126 126 * @since 2.1.0 127 127 */ 128 128 function send() { 129 header('Content-Type: text/xml');129 wp_header( 'Content-Type: text/xml' ); 130 130 echo "<?xml version='1.0' standalone='yes'?><wp_ajax>"; 131 131 foreach ( (array) $this->responses as $response ) 132 132 echo $response; -
wp-includes/class-simplepie.php
1749 1749 // If we want the XML, just output that with the most likely encoding and quit 1750 1750 if ($this->xml_dump) 1751 1751 { 1752 header('Content-type: text/xml; charset=' . $encodings[0]);1752 wp_header( 'Content-type: text/xml; charset=' . $encodings[0] ); 1753 1753 echo $data; 1754 1754 exit; 1755 1755 } … … 1860 1860 { 1861 1861 $header .= ' charset=UTF-8'; 1862 1862 } 1863 header($header);1863 wp_header( $header ); 1864 1864 } 1865 1865 } 1866 1866 … … 9299 9299 { 9300 9300 if (isset($file['headers']['content-type'])) 9301 9301 { 9302 header('Content-type:' . $file['headers']['content-type']);9302 wp_header( 'Content-type:' . $file['headers']['content-type'] ); 9303 9303 } 9304 9304 else 9305 9305 { 9306 header('Content-type: application/octet-stream');9306 wp_header( 'Content-type: application/octet-stream' ); 9307 9307 } 9308 header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days9308 wp_header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 604800 ) . ' GMT' ); // 7 days 9309 9309 echo $file['body']; 9310 9310 exit; 9311 9311 } … … 11368 11368 { 11369 11369 ob_start('ob_gzhandler'); 11370 11370 } 11371 header('Content-type: text/javascript; charset: UTF-8');11372 header('Cache-Control: must-revalidate');11373 header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 604800) . ' GMT'); // 7 days11371 wp_header( 'Content-type: text/javascript; charset: UTF-8' ); 11372 wp_header( 'Cache-Control: must-revalidate' ); 11373 wp_header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 604800 ) . ' GMT' ); // 7 days 11374 11374 ?> 11375 11375 function embed_odeo(link) { 11376 11376 document.writeln('<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url='+link+'"></embed>'); -
wp-includes/class-wp-atom-server.php
670 670 $this->internal_error(__('Error occurred while accessing post metadata for file location.')); 671 671 672 672 status_header('200'); 673 header('Content-Type: ' . $entry['post_mime_type']);674 header('Connection: close');673 wp_header( 'Content-Type: ' . $entry['post_mime_type'] ); 674 wp_header( 'Connection: close' ); 675 675 676 676 if ( $fp = fopen($location, "rb") ) { 677 677 status_header('200'); 678 header('Content-Type: ' . $entry['post_mime_type']);679 header('Connection: close');678 wp_header( 'Content-Type: ' . $entry['post_mime_type'] ); 679 wp_header( 'Connection: close' ); 680 680 681 681 while ( !feof($fp) ) { 682 682 echo fread($fp, 4096); … … 1094 1094 * @since 2.2.0 1095 1095 */ 1096 1096 function ok() { 1097 header('Content-Type: text/plain');1097 wp_header( 'Content-Type: text/plain' ); 1098 1098 status_header('200'); 1099 1099 wp_die(); 1100 1100 } … … 1105 1105 * @since 2.2.0 1106 1106 */ 1107 1107 function no_content() { 1108 header('Content-Type: text/plain');1108 wp_header( 'Content-Type: text/plain' ); 1109 1109 status_header('204'); 1110 1110 echo "Moved to Trash."; 1111 1111 wp_die(); … … 1119 1119 * @param string $msg Optional. Status string. 1120 1120 */ 1121 1121 function internal_error($msg = 'Internal Server Error') { 1122 header('Content-Type: text/plain');1122 wp_header( 'Content-Type: text/plain' ); 1123 1123 status_header('500'); 1124 1124 echo $msg; 1125 1125 wp_die(); … … 1131 1131 * @since 2.2.0 1132 1132 */ 1133 1133 function bad_request() { 1134 header('Content-Type: text/plain');1134 wp_header( 'Content-Type: text/plain' ); 1135 1135 status_header('400'); 1136 1136 wp_die(); 1137 1137 } … … 1142 1142 * @since 2.2.0 1143 1143 */ 1144 1144 function length_required() { 1145 header("HTTP/1.1 411 Length Required");1146 header('Content-Type: text/plain');1145 wp_header( "HTTP/1.1 411 Length Required" ); 1146 wp_header( 'Content-Type: text/plain' ); 1147 1147 status_header('411'); 1148 1148 wp_die(); 1149 1149 } … … 1154 1154 * @since 2.2.0 1155 1155 */ 1156 1156 function invalid_media() { 1157 header("HTTP/1.1 415 Unsupported Media Type");1158 header('Content-Type: text/plain');1157 wp_header( "HTTP/1.1 415 Unsupported Media Type" ); 1158 wp_header( 'Content-Type: text/plain' ); 1159 1159 wp_die(); 1160 1160 } 1161 1161 … … 1165 1165 * @since 2.6.0 1166 1166 */ 1167 1167 function forbidden($reason='') { 1168 header('Content-Type: text/plain');1168 wp_header( 'Content-Type: text/plain' ); 1169 1169 status_header('403'); 1170 1170 echo $reason; 1171 1171 wp_die(); … … 1177 1177 * @since 2.2.0 1178 1178 */ 1179 1179 function not_found() { 1180 header('Content-Type: text/plain');1180 wp_header( 'Content-Type: text/plain' ); 1181 1181 status_header('404'); 1182 1182 wp_die(); 1183 1183 } … … 1188 1188 * @since 2.2.0 1189 1189 */ 1190 1190 function not_allowed($allow) { 1191 header('Allow: ' . join(',', $allow));1191 wp_header( 'Allow: ' . join( ',', $allow ) ); 1192 1192 status_header('405'); 1193 1193 wp_die(); 1194 1194 } … … 1213 1213 </html> 1214 1214 1215 1215 EOD; 1216 header('HTTP/1.1 302 Moved');1217 header('Content-Type: text/html');1218 header('Location: ' . $url);1216 wp_header( 'HTTP/1.1 302 Moved' ); 1217 wp_header( 'Content-Type: text/html' ); 1218 wp_header( 'Location: ' . $url ); 1219 1219 echo $content; 1220 1220 wp_die(); 1221 1221 … … 1227 1227 * @since 2.2.0 1228 1228 */ 1229 1229 function client_error($msg = 'Client Error') { 1230 header('Content-Type: text/plain');1230 wp_header( 'Content-Type: text/plain' ); 1231 1231 status_header('400'); 1232 1232 wp_die(); 1233 1233 } … … 1249 1249 $edit = $this->app_base . "attachments/$post_ID"; 1250 1250 break; 1251 1251 } 1252 header("Content-Type: $this->ATOM_CONTENT_TYPE");1252 wp_header( "Content-Type: $this->ATOM_CONTENT_TYPE" ); 1253 1253 if (isset($ctloc)) 1254 header('Content-Location: ' . $ctloc);1255 header('Location: ' . $edit);1254 wp_header( 'Content-Location: ' . $ctloc ); 1255 wp_header( 'Location: ' . $edit ); 1256 1256 status_header('201'); 1257 1257 echo $content; 1258 1258 wp_die(); … … 1267 1267 */ 1268 1268 function auth_required($msg) { 1269 1269 nocache_headers(); 1270 header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"');1271 header("HTTP/1.1 401 $msg");1272 header('Status: 401 ' . $msg);1273 header('Content-Type: text/html');1270 wp_header( 'WWW-Authenticate: Basic realm="WordPress Atom Protocol"' ); 1271 wp_header( "HTTP/1.1 401 $msg" ); 1272 wp_header( 'Status: 401 ' . $msg ); 1273 wp_header( 'Content-Type: text/html' ); 1274 1274 $content = <<<EOD 1275 1275 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> 1276 1276 <html> … … 1299 1299 function output($xml, $ctype = 'application/atom+xml') { 1300 1300 status_header('200'); 1301 1301 $xml = '<?xml version="1.0" encoding="' . strtolower(get_option('blog_charset')) . '"?>'."\n".$xml; 1302 header('Connection: close');1303 header('Content-Length: '. strlen($xml));1304 header('Content-Type: ' . $ctype);1305 header('Content-Disposition: attachment; filename=atom.xml');1306 header('Date: '. date('r'));1302 wp_header( 'Connection: close' ); 1303 wp_header( 'Content-Length: '. strlen( $xml ) ); 1304 wp_header( 'Content-Type: ' . $ctype ); 1305 wp_header( 'Content-Disposition: attachment; filename=atom.xml' ); 1306 wp_header( 'Date: '. date( 'r' ) ); 1307 1307 if ($this->do_output) 1308 1308 echo $xml; 1309 1309 wp_die(); … … 1421 1421 return; 1422 1422 } 1423 1423 $wp_etag = md5($wp_last_modified); 1424 @header("Last-Modified: $wp_last_modified");1425 @header("ETag: $wp_etag");1424 wp_header( "Last-Modified: $wp_last_modified" ); 1425 wp_header( "ETag: $wp_etag" ); 1426 1426 1427 1427 // Support for Conditional GET 1428 1428 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) -
wp-includes/link-template.php
2385 2385 if ( empty($shortlink) ) 2386 2386 return; 2387 2387 2388 header('Link: <' . $shortlink . '>; rel=shortlink', false);2388 wp_header( 'Link: <' . $shortlink . '>; rel=shortlink', false ); 2389 2389 } 2390 2390 2391 2391 /** -
wp-includes/ms-files.php
38 38 else 39 39 $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 ); 40 40 41 header( 'Content-Type: ' . $mimetype ); // always send this41 wp_header( 'Content-Type: ' . $mimetype ); // always send this 42 42 if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) ) 43 header( 'Content-Length: ' . filesize( $file ) );43 wp_header( 'Content-Length: ' . filesize( $file ) ); 44 44 45 45 // Optional support for X-Sendfile and X-Accel-Redirect 46 46 if ( WPMU_ACCEL_REDIRECT ) { 47 header( 'X-Accel-Redirect: ' . str_replace( WP_CONTENT_DIR, '', $file ) );47 wp_header( 'X-Accel-Redirect: ' . str_replace( WP_CONTENT_DIR, '', $file ) ); 48 48 exit; 49 49 } elseif ( WPMU_SENDFILE ) { 50 header( 'X-Sendfile: ' . $file );50 wp_header( 'X-Sendfile: ' . $file ); 51 51 exit; 52 52 } 53 53 54 54 $last_modified = gmdate( 'D, d M Y H:i:s', filemtime( $file ) ); 55 55 $etag = '"' . md5( $last_modified ) . '"'; 56 header( "Last-Modified: $last_modified GMT" );57 header( 'ETag: ' . $etag );58 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' );56 wp_header( "Last-Modified: $last_modified GMT" ); 57 wp_header( 'ETag: ' . $etag ); 58 wp_header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' ); 59 59 60 60 // Support for Conditional GET 61 61 $client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false; -
wp-includes/js/tinymce/wp-mce-help.php
7 7 8 8 /** @ignore */ 9 9 require_once('../../../wp-load.php'); 10 header('Content-Type: text/html; charset=' . get_bloginfo('charset'));10 wp_header( 'Content-Type: text/html; charset=' . get_bloginfo( 'charset' ) ); 11 11 ?> 12 12 <!DOCTYPE html> 13 13 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> -
wp-includes/js/tinymce/plugins/spellchecker/rpc.php
10 10 require_once("./includes/general.php"); 11 11 12 12 // Set RPC response headers 13 header('Content-Type: text/plain');14 header('Content-Encoding: UTF-8');15 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");16 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");17 header("Cache-Control: no-store, no-cache, must-revalidate");18 header("Cache-Control: post-check=0, pre-check=0", false);19 header("Pragma: no-cache");13 wp_header( 'Content-Type: text/plain' ); 14 wp_header( 'Content-Encoding: UTF-8' ); 15 wp_header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 16 wp_header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" ); 17 wp_header( "Cache-Control: no-store, no-cache, must-revalidate" ); 18 wp_header( "Cache-Control: post-check=0, pre-check=0", false ); 19 wp_header( "Pragma: no-cache" ); 20 20 21 21 $raw = ""; 22 22 -
wp-includes/js/tinymce/wp-tinymce.php
21 21 22 22 $expires_offset = 31536000; 23 23 24 header('Content-Type: application/x-javascript; charset=UTF-8');25 header('Vary: Accept-Encoding'); // Handle proxies26 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');27 header("Cache-Control: public, max-age=$expires_offset");24 wp_header( 'Content-Type: application/x-javascript; charset=UTF-8' ); 25 wp_header( 'Vary: Accept-Encoding' ); // Handle proxies 26 wp_header( 'Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT' ); 27 wp_header( "Cache-Control: public, max-age=$expires_offset" ); 28 28 29 29 if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING']) 30 30 && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) { 31 31 32 header('Content-Encoding: gzip');32 wp_header( 'Content-Encoding: gzip' ); 33 33 echo $file; 34 34 } else { 35 35 echo get_file($basepath . '/tiny_mce.js'); -
wp-includes/load.php
122 122 */ 123 123 function wp_favicon_request() { 124 124 if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) { 125 header('Content-Type: image/vnd.microsoft.icon');126 header('Content-Length: 0');125 wp_header( 'Content-Type: image/vnd.microsoft.icon' ); 126 wp_header( 'Content-Length: 0' ); 127 127 exit; 128 128 } 129 129 } … … 163 163 $protocol = $_SERVER["SERVER_PROTOCOL"]; 164 164 if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol ) 165 165 $protocol = 'HTTP/1.0'; 166 header( "$protocol 503 Service Unavailable", true, 503 );167 header( 'Content-Type: text/html; charset=utf-8' );168 header( 'Retry-After: 600' );166 wp_header( "$protocol 503 Service Unavailable", true, 503 ); 167 wp_header( 'Content-Type: text/html; charset=utf-8' ); 168 wp_header( 'Retry-After: 600' ); 169 169 ?> 170 170 <!DOCTYPE html> 171 171 <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>> -
wp-includes/feed-atom-comments.php
5 5 * @package WordPress 6 6 */ 7 7 8 header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);8 wp_header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true ); 9 9 echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'; 10 10 ?> 11 11 <feed -
wp-includes/feed-rss2.php
5 5 * @package WordPress 6 6 */ 7 7 8 header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);8 wp_header( 'Content-Type: ' . feed_content_type( 'rss-http' ) . '; charset=' . get_option( 'blog_charset' ), true ); 9 9 $more = 1; 10 10 11 11 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> -
wp-includes/feed-atom.php
5 5 * @package WordPress 6 6 */ 7 7 8 header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);8 wp_header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true ); 9 9 $more = 1; 10 10 11 11 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> -
wp-includes/feed-rss2-comments.php
5 5 * @package WordPress 6 6 */ 7 7 8 header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);8 wp_header( 'Content-Type: ' . feed_content_type( 'rss-http' ) . '; charset=' . get_option( 'blog_charset' ), true ); 9 9 10 10 echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; 11 11 ?> -
xmlrpc.php
29 29 include('./wp-load.php'); 30 30 31 31 if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd 32 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);32 wp_header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); 33 33 ?> 34 34 <?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> 35 35 <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd"> -
wp-links-opml.php
14 14 15 15 require_once('./wp-load.php'); 16 16 17 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);17 wp_header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); 18 18 $link_cat = ''; 19 19 if ( !empty($_GET['link_cat']) ) { 20 20 $link_cat = $_GET['link_cat']; -
wp-login.php
359 359 360 360 nocache_headers(); 361 361 362 header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));362 wp_header( 'Content-Type: '.get_bloginfo( 'html_type' ).'; charset='.get_bloginfo( 'charset' ) ); 363 363 364 364 if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set 365 365 if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) -
wp-comments-post.php
6 6 */ 7 7 8 8 if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) { 9 header('Allow: POST');10 header('HTTP/1.1 405 Method Not Allowed');11 header('Content-Type: text/plain');9 wp_header( 'Allow: POST' ); 10 wp_header( 'HTTP/1.1 405 Method Not Allowed' ); 11 wp_header( 'Content-Type: text/plain' ); 12 12 exit; 13 13 } 14 14