From cacf5e345f09effb33abce0c18ba821b5ba750a1 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 23 Jul 2006 19:20:11 +0000 Subject: [PATCH] Trim theme and plugin data. fixes #2943 git-svn-id: http://svn.automattic.com/wordpress/trunk@4035 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 10 +++++----- wp-includes/theme.php | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 7d9fa3925c..b35214f599 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1612,23 +1612,23 @@ function get_plugin_data($plugin_file) { preg_match("|Author:(.*)|i", $plugin_data, $author_name); preg_match("|Author URI:(.*)|i", $plugin_data, $author_uri); if (preg_match("|Version:(.*)|i", $plugin_data, $version)) - $version = $version[1]; + $version = trim($version[1]); else $version = ''; - $description = wptexturize($description[1]); + $description = wptexturize(trim($description[1])); $name = $plugin_name[1]; $name = trim($name); $plugin = $name; if ('' != $plugin_uri[1] && '' != $name) { - $plugin = ''.$plugin.''; + $plugin = ''.$plugin.''; } if ('' == $author_uri[1]) { - $author = $author_name[1]; + $author = trim($author_name[1]); } else { - $author = ''.$author_name[1].''; + $author = '' . trim($author_name[1]) . ''; } return array ('Name' => $name, 'Title' => $plugin, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1]); diff --git a/wp-includes/theme.php b/wp-includes/theme.php index d7dcff0221..b93e653819 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -50,24 +50,24 @@ function get_theme_data($theme_file) { 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 = $version[1]; + $version = trim($version[1]); else $version =''; if ( preg_match("|Status:(.*)|i", $theme_data, $status) ) - $status = $status[1]; + $status = trim($status[1]); else - $status ='publish'; + $status = 'publish'; - $description = wptexturize($description[1]); + $description = wptexturize(trim($description[1])); $name = $theme_name[1]; $name = trim($name); $theme = $name; if ( '' == $author_uri[1] ) { - $author = $author_name[1]; + $author = trim($author_name[1]); } else { - $author = '' . $author_name[1] . ''; + $author = '' . trim($author_name[1]) . ''; } return array('Name' => $name, 'Title' => $theme, 'Description' => $description, 'Author' => $author, 'Version' => $version, 'Template' => $template[1], 'Status' => $status);