diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-09-03 18:02:00 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-09-03 18:02:00 -0400 |
commit | ffd58d06fa827827c696cb46e5c0e2fca3c240bc (patch) | |
tree | 65674dd49faf5bfbadc6af1cbead57b5055290c2 /app | |
parent | 75a9e01a9854efd170a03f441f9703de9d77eeb8 (diff) |
Support version operators for plugin directory: >= and >
Diffstat (limited to 'app')
-rw-r--r-- | app/Core/Plugin/Directory.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Core/Plugin/Directory.php b/app/Core/Plugin/Directory.php index 21f11ca9..27c3514e 100644 --- a/app/Core/Plugin/Directory.php +++ b/app/Core/Plugin/Directory.php @@ -40,6 +40,13 @@ class Directory extends BaseCore return true; } + foreach (array('>=', '>') as $operator) { + if (strpos($plugin['compatible_version'], $operator) === 0) { + $pluginVersion = substr($plugin['compatible_version'], strlen($operator)); + return version_compare($appVersion, $pluginVersion, $operator); + } + } + return $plugin['compatible_version'] === $appVersion; } |