diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index fa65037250..c97b2db963 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -2,11 +2,12 @@ function get_plugin_data( $plugin_file ) { $plugin_data = implode( '', file( $plugin_file )); - preg_match( "|Plugin Name:(.*)|i", $plugin_data, $plugin_name ); - preg_match( "|Plugin URI:(.*)|i", $plugin_data, $plugin_uri ); - preg_match( "|Description:(.*)|i", $plugin_data, $description ); - preg_match( "|Author:(.*)|i", $plugin_data, $author_name ); - preg_match( "|Author URI:(.*)|i", $plugin_data, $author_uri ); + preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name ); + preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri ); + preg_match( '|Description:(.*)$|mi', $plugin_data, $description ); + preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name ); + preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri ); + if ( preg_match( "|Version:(.*)|i", $plugin_data, $version )) $version = trim( $version[1] ); else diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index c00ac7f9a7..c2329b5e3c 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -33,13 +33,14 @@ function get_page_templates() { if ( is_array( $templates ) ) { foreach ( $templates as $template ) { $template_data = implode( '', file( ABSPATH.$template )); - preg_match( "|Template Name:(.*)|i", $template_data, $name ); - preg_match( "|Description:(.*)|i", $template_data, $description ); + + preg_match( '|Template Name:(.*)$|mi', $template_data, $name ); + preg_match( '|Description:(.*)$|mi', $template_data, $description ); $name = $name[1]; $description = $description[1]; - if (!empty ( $name ) ) { + if ( !empty( $name ) ) { $page_templates[trim( $name )] = basename( $template ); } } diff --git a/wp-includes/theme.php b/wp-includes/theme.php index eef7b6c224..fd73a5f550 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -73,12 +73,12 @@ function get_theme_data( $theme_file ) { $theme_data = implode( '', file( $theme_file ) ); $theme_data = str_replace ( '\r', '\n', $theme_data ); - preg_match( '|Theme Name:(.*)|i', $theme_data, $theme_name ); - preg_match( '|Theme URI:(.*)|i', $theme_data, $theme_uri ); - preg_match( '|Description:(.*)|i', $theme_data, $description ); - preg_match( '|Author:(.*)|i', $theme_data, $author_name ); - preg_match( '|Author URI:(.*)|i', $theme_data, $author_uri ); - preg_match( '|Template:(.*)|i', $theme_data, $template ); + preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name ); + preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ); + preg_match( '|Description:(.*)$|mi', $theme_data, $description ); + preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ); + preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ); + preg_match( '|Template:(.*)$|mi', $theme_data, $template ); if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) ) $version = wp_kses( trim( $version[1] ), $themes_allowed_tags );