Make get_file_data() regex more precise. Fixes #15193
git-svn-id: https://develop.svn.wordpress.org/trunk@16215 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f159895605
commit
b3d19ecb16
|
@ -4242,7 +4242,7 @@ function get_file_data( $file, $default_headers, $context = '' ) {
|
||||||
|
|
||||||
|
|
||||||
foreach ( $all_headers as $field => $regex ) {
|
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} ) )
|
if ( !empty( ${$field} ) )
|
||||||
${$field} = _cleanup_header_comment( ${$field}[1] );
|
${$field} = _cleanup_header_comment( ${$field}[1] );
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue