Keep greedy regex's in control. fixes #4165
git-svn-id: https://develop.svn.wordpress.org/trunk@5630 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e6d32e8761
commit
e2513b5643
@ -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
|
||||
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user