Make WordPress Core

Changeset 5630


Ignore:
Timestamp:
06/02/2007 12:02:06 AM (18 years ago)
Author:
rob1n
Message:

Keep greedy regex's in control. fixes #4165

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r5566 r5630  
    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] );
  • trunk/wp-admin/includes/theme.php

    r5566 r5630  
    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            }
  • trunk/wp-includes/theme.php

    r5581 r5630  
    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 ) )
Note: See TracChangeset for help on using the changeset viewer.