Fix handling of information on updates for absent plugins

This commit is contained in:
Fedor A. Fetisov 2018-02-06 02:11:36 +03:00
parent efa1372cdc
commit 2b6779af8f

View File

@ -298,6 +298,20 @@ class UpdateChecker
} }
} }
// Remove information about updates for absent plugins.
$updates = AvailableUpdate::all();
$plugins = PluginUtils::discoverPlugins();
foreach ($updates as $update) {
$name = $update->target;
// Skip information about the core.
if (!strcmp($name, 'core')) {
continue;
}
elseif (!in_array($name, $plugins)) {
$this->deleteUpdate($name);
}
}
return true; return true;
} }