diff options
author | Frederic Guillot <fred@kanboard.net> | 2017-01-08 17:02:31 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2017-01-08 17:02:31 -0500 |
commit | 07f9700179da74b056485375652c3b26d6fbce0d (patch) | |
tree | 027408d8895514daa33297d1fbfdda7f26f3dc1c /app/Core/Plugin/Directory.php | |
parent | 17ac414d744155d77c729f150115e8fd9e18f285 (diff) |
Offer the possibility to define version compatibility from plugins
Diffstat (limited to 'app/Core/Plugin/Directory.php')
-rw-r--r-- | app/Core/Plugin/Directory.php | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/app/Core/Plugin/Directory.php b/app/Core/Plugin/Directory.php index 27c3514e..dc32e655 100644 --- a/app/Core/Plugin/Directory.php +++ b/app/Core/Plugin/Directory.php @@ -36,18 +36,7 @@ class Directory extends BaseCore */ public function isCompatible(array $plugin, $appVersion = APP_VERSION) { - if (strpos($appVersion, 'master') !== false) { - 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; + return Version::isCompatible($plugin['compatible_version'], $appVersion); } /** |