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
path: root/core
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2019-05-06 01:28:39 +0300
committerGitHub <noreply@github.com>2019-05-06 01:28:39 +0300
commit7d97f5db7280626c40be64f8e452d248f959a294 (patch)
treebb04d2accefee81f69973f2c90489e31673165f3 /core
parentc316594c47c0b52a79f1177dbecf55ef532d64c9 (diff)
Do not create request to validate license in tracker mode (#14405)
* Do not create request to validate license in tracker mode fix https://github.com/matomo-org/matomo/issues/14401 * be a bit more specific we assume license is not missing in tracker mode
Diffstat (limited to 'core')
-rw-r--r--core/Plugin/Manager.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php
index 39d8d637bc..834bfdb3d2 100644
--- a/core/Plugin/Manager.php
+++ b/core/Plugin/Manager.php
@@ -30,6 +30,7 @@ use Piwik\Plugin\Dimension\ConversionDimension;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Settings\Storage as SettingsStorage;
use Piwik\SettingsPiwik;
+use Piwik\SettingsServer;
use Piwik\Theme;
use Piwik\Translation\Translator;
use Piwik\Updater;
@@ -1066,7 +1067,9 @@ class Manager
if ($cache->contains($cacheKey)) {
$pluginLicenseInfo = $cache->fetch($cacheKey);
- } else {
+ } elseif (!SettingsServer::isTrackerApiRequest()) {
+ // prevent requesting license info during a tracker request see https://github.com/matomo-org/matomo/issues/14401
+ // as possibly many instances would try to do this at the same time
try {
$plugins = StaticContainer::get('Piwik\Plugins\Marketplace\Plugins');
$licenseInfo = $plugins->getLicenseValidInfo($pluginName);
@@ -1077,6 +1080,9 @@ class Manager
$pluginLicenseInfo = array('missing' => !empty($licenseInfo['isMissingLicense']));
$sixHours = 3600 * 6;
$cache->save($cacheKey, $pluginLicenseInfo, $sixHours);
+ } else {
+ // tracker mode, we assume it is not missing until cache is written
+ $pluginLicenseInfo = array('missing' => false);
}
if (!empty($pluginLicenseInfo['missing']) && (!defined('PIWIK_TEST_MODE') || !PIWIK_TEST_MODE)) {