Prevent plugin update notification if plugin not compatible

This commit is contained in:
Andrew Z
2019-01-17 00:28:54 -05:00
parent f8fa5b5b2d
commit c2d1a9304f
@@ -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");
}
}