Normalization of newlines fixes #1020, also did some minor reformatting.

git-svn-id: http://svn.automattic.com/wordpress/trunk@4546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2006-11-29 23:18:35 +00:00
parent 3a72d82880
commit 67bc138cfd
1 changed files with 17 additions and 16 deletions

View File

@ -57,17 +57,18 @@ function get_template_directory_uri() {
function get_theme_data( $theme_file ) {
$theme_data = implode( '', file( $theme_file ) );
preg_match("|Theme Name:(.*)|i", $theme_data, $theme_name);
preg_match("|Theme URI:(.*)|i", $theme_data, $theme_uri);
preg_match("|Description:(.*)|i", $theme_data, $description);
preg_match("|Author:(.*)|i", $theme_data, $author_name);
preg_match("|Author URI:(.*)|i", $theme_data, $author_uri);
preg_match("|Template:(.*)|i", $theme_data, $template);
if ( preg_match("|Version:(.*)|i", $theme_data, $version) )
$theme_data = str_replace ( '\r', '\n', $theme_data );
preg_match( '|Theme Name:(.*)|i', $theme_data, $theme_name );
preg_match( '|Theme URI:(.*)|i', $theme_data, $theme_uri );
preg_match( '|Description:(.*)|i', $theme_data, $description );
preg_match( '|Author:(.*)|i', $theme_data, $author_name );
preg_match( '|Author URI:(.*)|i', $theme_data, $author_uri );
preg_match( '|Template:(.*)|i', $theme_data, $template );
if ( preg_match( '|Version:(.*)|i', $theme_data, $version ) )
$version = trim( $version[1] );
else
$version ='';
if ( preg_match("|Status:(.*)|i", $theme_data, $status) )
if ( preg_match('|Status:(.*)|i', $theme_data, $status) )
$status = trim($status[1]);
else
$status = 'publish';