From c2d1a9304f012a41bf7f1b42d81d90ee2b1cc674 Mon Sep 17 00:00:00 2001 From: Andrew Z Date: Thu, 17 Jan 2019 00:28:54 -0500 Subject: [PATCH] Prevent plugin update notification if plugin not compatible --- plugins/dynamix.plugin.manager/scripts/plugincheck | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/dynamix.plugin.manager/scripts/plugincheck b/plugins/dynamix.plugin.manager/scripts/plugincheck index 20ce7f9ac..12327e4ff 100755 --- a/plugins/dynamix.plugin.manager/scripts/plugincheck +++ b/plugins/dynamix.plugin.manager/scripts/plugincheck @@ -30,8 +30,9 @@ foreach (glob("/tmp/plugins/*.plg", GLOB_NOSORT) as $file) { if (in_array($name,$builtin)) continue; $old = plugin('version', "/var/log/plugins/$name.plg"); $new = plugin('version', $file); + $min = plugin('min',$file) ?: $current['version']; // silently suppress bad download of PLG file - if (strcmp($new, $old) > 0) { + if ( (strcmp($new, $old) > 0) && ! version_compare($min,$current['version'],">") ) { exec("$notify -e ".escapeshellarg("Plugin - $name [$new]")." -s ".escapeshellarg("Notice [$server] - Version update $new")." -d ".escapeshellarg("A new version of $name is available")." -i ".escapeshellarg("normal $output")." -x"); } }