Make WordPress Core

Changeset 10825


Ignore:
Timestamp:
03/20/2009 12:52:42 AM (16 years ago)
Author:
azaozz
Message:

Fix notice in wp-includes/theme.php, props filosofo, fixes #9336

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r10824 r10825  
    180180    $theme_data = implode( '', file( $theme_file ) );
    181181    $theme_data = str_replace ( '\r', '\n', $theme_data );
    182     preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name );
    183     preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri );
    184     preg_match( '|Description:(.*)$|mi', $theme_data, $description );
     182    if ( preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name ) )
     183        $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags );
     184    else
     185        $name = $theme = '';
     186
     187    if ( preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ) )
     188        $theme_uri = clean_url( trim( $theme_uri[1] ) );
     189    else
     190        $theme_uri = '';
     191       
     192    if ( preg_match( '|Description:(.*)$|mi', $theme_data, $description ) )
     193        $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) );
     194    else
     195        $description = '';
    185196
    186197    if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) )
     
    208219    else
    209220        $tags = array();
    210 
    211     $name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags );
    212     $theme_uri = clean_url( trim( $theme_uri[1] ) );
    213     $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) );
    214221
    215222    if ( preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ) ) {
Note: See TracChangeset for help on using the changeset viewer.