Ticket #20126: 20126.diff
| File 20126.diff, 1.4 KB (added by , 14 years ago) |
|---|
-
wp-includes/functions.php
3354 3354 // PHP will close file handle, but we are good citizens. 3355 3355 fclose( $fp ); 3356 3356 3357 if ( $context != '' ) { 3358 $extra_headers = apply_filters( "extra_{$context}_headers", array() ); 3359 3360 $extra_headers = array_flip( $extra_headers ); 3361 foreach( $extra_headers as $key=>$value ) { 3362 $extra_headers[$key] = $key; 3363 } 3357 if ( $context && $extra_headers = apply_filters( "extra_{$context}_headers", array() ) ) { 3358 $extra_headers = array_combine( $extra_headers, $extra_headers ); // keys equal values 3364 3359 $all_headers = array_merge( $extra_headers, (array) $default_headers ); 3365 3360 } else { 3366 3361 $all_headers = $default_headers; 3367 3362 } 3368 3363 3369 3364 foreach ( $all_headers as $field => $regex ) { 3370 preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); 3371 if ( !empty( ${$field} ) ) 3372 ${$field} = _cleanup_header_comment( ${$field}[1] ); 3365 if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) 3366 $file_headers[ $field ] = _cleanup_header_comment( $match[1] ); 3373 3367 else 3374 $ {$field}= '';3368 $file_headers[ $field ] = ''; 3375 3369 } 3376 3370 3377 $file_data = compact( array_keys( $all_headers ) ); 3378 3379 return $file_data; 3371 return $file_headers; 3380 3372 } 3381 3373 3382 3374 /**