WordPress.org

Make WordPress Core

Ticket #4165: 4165.diff

File 4165.diff, 3.1 KB (added by rob1n, 11 years ago)

might as well do them all

  • wp-includes/theme.php

     
    7373       
    7474        $theme_data = implode( '', file( $theme_file ) );
    7575        $theme_data = str_replace ( '\r', '\n', $theme_data );
    76         preg_match( '|Theme Name:(.*)|i', $theme_data, $theme_name );
    77         preg_match( '|Theme URI:(.*)|i', $theme_data, $theme_uri );
    78         preg_match( '|Description:(.*)|i', $theme_data, $description );
    79         preg_match( '|Author:(.*)|i', $theme_data, $author_name );
    80         preg_match( '|Author URI:(.*)|i', $theme_data, $author_uri );
    81         preg_match( '|Template:(.*)|i', $theme_data, $template );
     76        preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name );
     77        preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri );
     78        preg_match( '|Description:(.*)$|mi', $theme_data, $description );
     79        preg_match( '|Author:(.*)$|mi', $theme_data, $author_name );
     80        preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri );
     81        preg_match( '|Template:(.*)$|mi', $theme_data, $template );
    8282       
    8383        if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) )
    8484                $version = wp_kses( trim( $version[1] ), $themes_allowed_tags );
  • wp-admin/includes/plugin.php

     
    22
    33function get_plugin_data( $plugin_file ) {
    44        $plugin_data = implode( '', file( $plugin_file ));
    5         preg_match( "|Plugin Name:(.*)|i", $plugin_data, $plugin_name );
    6         preg_match( "|Plugin URI:(.*)|i", $plugin_data, $plugin_uri );
    7         preg_match( "|Description:(.*)|i", $plugin_data, $description );
    8         preg_match( "|Author:(.*)|i", $plugin_data, $author_name );
    9         preg_match( "|Author URI:(.*)|i", $plugin_data, $author_uri );
     5        preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name );
     6        preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri );
     7        preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
     8        preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
     9        preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
     10       
    1011        if ( preg_match( "|Version:(.*)|i", $plugin_data, $version ))
    1112                $version = trim( $version[1] );
    1213        else
  • wp-admin/includes/theme.php

     
    3333        if ( is_array( $templates ) ) {
    3434                foreach ( $templates as $template ) {
    3535                        $template_data = implode( '', file( ABSPATH.$template ));
    36                         preg_match( "|Template Name:(.*)|i", $template_data, $name );
    37                         preg_match( "|Description:(.*)|i", $template_data, $description );
     36                       
     37                        preg_match( '|Template Name:(.*)$|mi', $template_data, $name );
     38                        preg_match( '|Description:(.*)$|mi', $template_data, $description );
    3839
    3940                        $name = $name[1];
    4041                        $description = $description[1];
    4142
    42                         if (!empty ( $name ) ) {
     43                        if ( !empty( $name ) ) {
    4344                                $page_templates[trim( $name )] = basename( $template );
    4445                        }
    4546                }