diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-09 09:05:06 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-09 09:05:06 +0400 |
commit | 218e898c00d11e009b5276e74f3b68272475ec9c (patch) | |
tree | 5a90ffbb2417e0aa99a4e2821b2658c16a50dc3e /core/Plugin/Dependency.php | |
parent | 8fb9e31d02113dd2c62a710a54e9dfa2e91980af (diff) |
refs #4967 handle whitespace
Diffstat (limited to 'core/Plugin/Dependency.php')
-rw-r--r-- | core/Plugin/Dependency.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/Plugin/Dependency.php b/core/Plugin/Dependency.php index 733c1be2c0..0448f8a721 100644 --- a/core/Plugin/Dependency.php +++ b/core/Plugin/Dependency.php @@ -49,6 +49,7 @@ class Dependency public function getMissingVersions($currentVersion, $requiredVersion) { + $currentVersion = trim($currentVersion); $requiredVersions = explode(',' , (string) $requiredVersion); $missingVersions = array(); @@ -56,11 +57,13 @@ class Dependency foreach ($requiredVersions as $required) { $comparison = '>='; + $required = trim($required); if (preg_match('{^(<>|!=|>=?|<=?|==?)\s*(.*)}', $required, $matches)) { $required = $matches[2]; - $comparison = $matches[1]; + $comparison = trim($matches[1]); } + if (false === version_compare($currentVersion, $required, $comparison)) { $missingVersions[] = $comparison . $required; } |