diff options
author | mistic100 <mistic@piwigo.org> | 2014-07-06 14:05:05 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2014-07-06 14:05:05 +0000 |
commit | 1633d8ffaa38edb8abb530ef4e28cdc4ee816923 (patch) | |
tree | d6768d721c437d1494a9c379c2bd667ae70ea4d3 /admin/include/themes.class.php | |
parent | dbedfd173f087b7b7d6d1aefde09922d986c8429 (diff) |
improves regexes parsing plugins metadata
git-svn-id: http://piwigo.org/svn/trunk@28969 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include/themes.class.php')
-rw-r--r-- | admin/include/themes.class.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/admin/include/themes.class.php b/admin/include/themes.class.php index 5389eef58..df0e29e66 100644 --- a/admin/include/themes.class.php +++ b/admin/include/themes.class.php @@ -375,17 +375,17 @@ SELECT 'author' => '', 'mobile' => false, ); - $theme_data = implode( '', file($path.'/themeconf.inc.php') ); + $theme_data = implode('', file($path.'/themeconf.inc.php')); - if ( preg_match("|Theme Name: (.*)|", $theme_data, $val) ) + if (preg_match("|Theme Name:\\s*(.+)|", $theme_data, $val)) { $theme['name'] = trim( $val[1] ); } - if (preg_match("|Version: (.*)|", $theme_data, $val)) + if (preg_match("|Version:\\s*([\\w.-]+)|", $theme_data, $val)) { $theme['version'] = trim($val[1]); } - if ( preg_match("|Theme URI: (.*)|", $theme_data, $val) ) + if (preg_match("|Theme URI:\\s*(https?:\\/\\/.+)|", $theme_data, $val)) { $theme['uri'] = trim($val[1]); } @@ -393,15 +393,15 @@ SELECT { $theme['description'] = trim($desc); } - elseif ( preg_match("|Description: (.*)|", $theme_data, $val) ) + elseif (preg_match("|Description:\\s*(.+)|", $theme_data, $val)) { $theme['description'] = trim($val[1]); } - if ( preg_match("|Author: (.*)|", $theme_data, $val) ) + if (preg_match("|Author:\\s*(.+)|", $theme_data, $val)) { $theme['author'] = trim($val[1]); } - if ( preg_match("|Author URI: (.*)|", $theme_data, $val) ) + if (preg_match("|Author URI:\\s*(https?:\\/\\/.+)|", $theme_data, $val)) { $theme['author uri'] = trim($val[1]); } |