WordPress.org

Make WordPress Core

Ticket #33387: 33387.diff

File 33387.diff, 637 bytes (added by m_uysl, 3 years ago)
  • src/wp-includes/functions.php

     
    46074607        }
    46084608
    46094609        foreach ( $all_headers as $field => $regex ) {
    4610                 if ( preg_match( '/^[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] )
     4610                if ( preg_match( '/^(?:[ \t]*<\?php)?[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] )
    46114611                        $all_headers[ $field ] = _cleanup_header_comment( $match[1] );
    46124612                else
    46134613                        $all_headers[ $field ] = '';