From e127bcde706b4d21efc1685c522f7ff715a11cd6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 18 Jun 2021 14:03:58 +0000 Subject: [PATCH] Themes: Make sure `get_file_data()` recognizes headers prefixed by ``, which previously could not be recognized correctly. Props dd32, m_uysl, thomas-vitale, boblinthorst. Fixes #33387. Built from https://develop.svn.wordpress.org/trunk@51182 git-svn-id: http://core.svn.wordpress.org/trunk@50791 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 0ba059ba8e..71a0522139 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -6287,7 +6287,7 @@ function get_file_data( $file, $default_headers, $context = '' ) { } foreach ( $all_headers as $field => $regex ) { - if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) { + if ( preg_match( '/^(?:[ \t]*<\?php)?[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) { $all_headers[ $field ] = _cleanup_header_comment( $match[1] ); } else { $all_headers[ $field ] = ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index 9f7605b584..d84800b7d1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-beta2-51181'; +$wp_version = '5.8-beta2-51182'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.