- 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( _cleanup_header_comment($theme_name[1]), $themes_allowed_tags );
+ else
+ $name = $theme = '';
+
+ if ( preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ) )
+ $theme_uri = esc_url( _cleanup_header_comment($theme_uri[1]) );
+ else
+ $theme_uri = '';
+
+ if ( preg_match( '|Description:(.*)$|mi', $theme_data, $description ) )
+ $description = wptexturize( wp_kses( _cleanup_header_comment($description[1]), $themes_allowed_tags ) );
+ else
+ $description = '';