Ticket #3294: trac-3294-phpcs-fix-silenced-errors-2.patch
File trac-3294-phpcs-fix-silenced-errors-2.patch, 918 bytes (added by , 5 years ago) |
---|
-
src/includes/common/ajax.php
114 114 function bbp_ajax_headers() { 115 115 116 116 // Set the header content type 117 @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 118 @header( 'X-Robots-Tag: noindex' ); 117 if ( ! headers_sent() ) { 118 header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); 119 header( 'X-Robots-Tag: noindex' ); 120 } 119 121 120 122 // Disable content sniffing in browsers that support it 121 123 send_nosniff_header(); … … 153 155 } 154 156 155 157 // Send back the JSON 156 @header( 'Content-type: application/json' ); 158 if ( ! headers_sent() ) { 159 header( 'Content-type: application/json' ); 160 } 157 161 echo json_encode( $response ); 158 162 die(); 159 163 }