From ffd58d06fa827827c696cb46e5c0e2fca3c240bc Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 3 Sep 2016 18:02:00 -0400 Subject: Support version operators for plugin directory: >= and > --- app/Core/Plugin/Directory.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app') 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; } -- cgit v1.2.3