Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Aubry <mattab@users.noreply.github.com>2016-12-27 12:05:21 +0300
committerGitHub <noreply@github.com>2016-12-27 12:05:21 +0300
commit3ce6d87aa1e8d772fb727413346f8e7426c38706 (patch)
tree6c482bcf80ca998a695345397b0710e696bc1c9c /plugins/CoreUpdater/Controller.php
parentd1e80dc071780dda8ad7a79e82a4c874d3523d93 (diff)
File integrity checker now reports files found in the filesystem but not expected to be there (#11096)
* File integrity checker now reports files found in the filesystem but not expected to be there fixes #11087 * Move file integrity logic to own class * Fix bug in logic so that third party plugins are not listed * fix up some comments * Also report any hidden files not expected to be there * Issue a warning when file integrity didn't run for any reason. Safer choice * Ui tests
Diffstat (limited to 'plugins/CoreUpdater/Controller.php')
-rw-r--r--plugins/CoreUpdater/Controller.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php
index 143c9c04b9..cae8ec124c 100644
--- a/plugins/CoreUpdater/Controller.php
+++ b/plugins/CoreUpdater/Controller.php
@@ -12,22 +12,22 @@ use Exception;
use Piwik\AssetManager;
use Piwik\Common;
use Piwik\Config;
-use Piwik\Container\StaticContainer;
use Piwik\DbHelper;
use Piwik\Filechecks;
+use Piwik\FileIntegrity;
use Piwik\Filesystem;
use Piwik\Http;
use Piwik\Option;
use Piwik\Piwik;
-use Piwik\Plugin\Manager as PluginManager;
use Piwik\Plugin;
+use Piwik\Plugin\Manager as PluginManager;
use Piwik\Plugins\LanguagesManager\LanguagesManager;
use Piwik\Plugins\Marketplace\Plugins;
use Piwik\SettingsServer;
use Piwik\Updater as DbUpdater;
use Piwik\Version;
-use Piwik\View\OneClickDone;
use Piwik\View;
+use Piwik\View\OneClickDone;
class Controller extends \Piwik\Plugin\Controller
{
@@ -306,12 +306,13 @@ class Controller extends \Piwik\Plugin\Controller
}
// check file integrity
- $integrityInfo = Filechecks::getFileIntegrityInformation();
- if (isset($integrityInfo[1])) {
- if ($integrityInfo[0] == false) {
- $this->warningMessages[] = Piwik::translate('General_FileIntegrityWarningExplanation');
- }
- $this->warningMessages = array_merge($this->warningMessages, array_slice($integrityInfo, 1));
+ list($success, $messages) = FileIntegrity::getFileIntegrityInformation();
+
+ if (!$success) {
+ $this->warningMessages[] = Piwik::translate('General_FileIntegrityWarning');
+ }
+ if (count($messages) > 0) {
+ $this->warningMessages = array_merge($this->warningMessages, $messages);
}
Filesystem::deleteAllCacheOnUpdate();