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

git-svn-id: http://svn.automattic.com/wordpress/trunk@10825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-03-20 00:52:42 +00:00
parent c25364742c
commit 7510ca2238

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 );