Ticket #28926: 28926.patch
File 28926.patch, 1.3 KB (added by , 11 years ago) |
---|
-
src/wp-includes/theme.php
1040 1040 if ( 'remove-header' == $url ) 1041 1041 return false; 1042 1042 1043 if ( ! is_file( str_replace( get_site_url(), ABSPATH, $url ) ) ) 1044 return false; 1045 1043 1046 if ( is_random_header_image() ) 1044 1047 $url = get_random_header_image(); 1045 1048 … … 1149 1152 $header_images = array(); 1150 1153 1151 1154 // @todo caching 1152 $headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_option('stylesheet'), 'orderby' => 'none', 'nopaging' => true ) ); 1155 $headers = get_posts( array( 1156 'post_type' => 'attachment', 1157 'meta_key' => '_wp_attachment_is_custom_header', 1158 'meta_value' => get_option('stylesheet'), 1159 'orderby' => 'none', 1160 'nopaging' => true, 1161 ) ); 1153 1162 1154 1163 if ( empty( $headers ) ) 1155 1164 return array(); … … 1156 1165 1157 1166 foreach ( (array) $headers as $header ) { 1158 1167 $url = esc_url_raw( wp_get_attachment_url( $header->ID ) ); 1168 if ( ! is_file( str_replace( get_site_url(), ABSPATH, $url ) ) ) 1169 continue; 1170 1159 1171 $header_data = wp_get_attachment_metadata( $header->ID ); 1160 1172 $header_index = basename($url); 1161 1173 $header_images[$header_index] = array();