From 3230b44f637ce37233ed33fecad281163aef7ef9 Mon Sep 17 00:00:00 2001 From: scribu Date: Tue, 23 Nov 2010 19:37:31 +0000 Subject: [PATCH] Make get_file_data() regex even more precise. Props hakre. See #15193 git-svn-id: http://svn.automattic.com/wordpress/trunk@16552 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index ea64136433..443b7d866f 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4237,9 +4237,8 @@ function get_file_data( $file, $default_headers, $context = '' ) { $all_headers = $default_headers; } - foreach ( $all_headers as $field => $regex ) { - preg_match( '/^[\s\/*#]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); + preg_match( '/^[ \t\/*#]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); if ( !empty( ${$field} ) ) ${$field} = _cleanup_header_comment( ${$field}[1] ); else