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

git-svn-id: https://develop.svn.wordpress.org/trunk@10825 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-03-20 00:52:42 +00:00
parent f5942a0a73
commit 28db896510

View File

@ -179,9 +179,20 @@ function get_theme_data( $theme_file ) {
$theme_data = implode( '', file( $theme_file ) );
$theme_data = str_replace ( '\r', '\n', $theme_data );
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 );
if ( preg_match( '|Theme Name:(.*)$|mi', $theme_data, $theme_name ) )
$name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags );
else
$name = $theme = '';
if ( preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ) )
$theme_uri = clean_url( trim( $theme_uri[1] ) );
else
$theme_uri = '';
if ( preg_match( '|Description:(.*)$|mi', $theme_data, $description ) )
$description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) );
else
$description = '';
if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) )
$author_uri = clean_url( trim( $author_uri[1]) );
@ -208,10 +219,6 @@ function get_theme_data( $theme_file ) {
else
$tags = array();
$name = $theme = wp_kses( trim( $theme_name[1] ), $themes_allowed_tags );
$theme_uri = clean_url( trim( $theme_uri[1] ) );
$description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) );
if ( preg_match( '|Author:(.*)$|mi', $theme_data, $author_name ) ) {
if ( empty( $author_uri ) ) {
$author = wp_kses( trim( $author_name[1] ), $themes_allowed_tags );