From a1d7b0f9457e496a39e67cc18fec3fe863dbb50e Mon Sep 17 00:00:00 2001 From: scribu Date: Fri, 5 Nov 2010 22:22:28 +0000 Subject: [PATCH] Make get_file_data() regex more precise. Fixes #15193 git-svn-id: http://svn.automattic.com/wordpress/trunk@16215 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f39302f772..fcbe86e5b3 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -4242,7 +4242,7 @@ function get_file_data( $file, $default_headers, $context = '' ) { foreach ( $all_headers as $field => $regex ) { - preg_match( '/' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); + preg_match( '/^[\s\/*#]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, ${$field}); if ( !empty( ${$field} ) ) ${$field} = _cleanup_header_comment( ${$field}[1] ); else