diff options
author | sgiehl <stefan@matomo.org> | 2022-10-13 10:50:23 +0300 |
---|---|---|
committer | sgiehl <stefan@matomo.org> | 2022-10-13 10:50:23 +0300 |
commit | 9d54f79bc3aceb30191aa264531c2c4af79dc6ee (patch) | |
tree | d17892e12dfe5893c377cee020fa68cc4ee87943 /plugins/CoreAdminHome | |
parent | ff812d1faeab4d7f712289b53883b14a4e6910cb (diff) | |
parent | 2ad23db2c3a96faed4bc1c1914849bd36c6c4f81 (diff) |
Merge branch '4.x-dev' into 5.x-dev
Diffstat (limited to 'plugins/CoreAdminHome')
-rw-r--r-- | plugins/CoreAdminHome/API.php | 4 | ||||
-rw-r--r-- | plugins/CoreAdminHome/OptOutManager.php | 2 | ||||
-rw-r--r-- | plugins/CoreAdminHome/Tasks.php | 8 | ||||
-rw-r--r-- | plugins/CoreAdminHome/tests/Framework/Mock/API.php | 2 |
4 files changed, 12 insertions, 4 deletions
diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php index 4b0e4380c2..91f551a1d8 100644 --- a/plugins/CoreAdminHome/API.php +++ b/plugins/CoreAdminHome/API.php @@ -151,7 +151,7 @@ class API extends \Piwik\Plugin\API * @hideExceptForSuperUser */ public function invalidateArchivedReports($idSites, $dates, $period = false, $segment = false, $cascadeDown = false, - $_forceInvalidateNonexistant = false) + $_forceInvalidateNonexistent = false) { $idSites = Site::getIdSitesFromIdSitesString($idSites); if (empty($idSites)) { @@ -169,7 +169,7 @@ class API extends \Piwik\Plugin\API /** Date[]|string[] $dates */ list($dates, $invalidDates) = $this->getDatesToInvalidateFromString($dates, $period); - $invalidationResult = $this->invalidator->markArchivesAsInvalidated($idSites, $dates, $period, $segment, (bool)$cascadeDown, (bool)$_forceInvalidateNonexistant); + $invalidationResult = $this->invalidator->markArchivesAsInvalidated($idSites, $dates, $period, $segment, (bool)$cascadeDown, (bool)$_forceInvalidateNonexistent); $output = $invalidationResult->makeOutputLogs(); if ($invalidDates) { diff --git a/plugins/CoreAdminHome/OptOutManager.php b/plugins/CoreAdminHome/OptOutManager.php index 90c0b66943..53fce0d4d6 100644 --- a/plugins/CoreAdminHome/OptOutManager.php +++ b/plugins/CoreAdminHome/OptOutManager.php @@ -198,7 +198,7 @@ class OptOutManager string $fontSize, string $fontFamily, bool $applyStyling, bool $showIntro): string { return '<div id="matomo-opt-out"></div> -<script src="'.rtrim($matomoUrl, '/').'/index.php?module=CoreAdminHome&action=optOutJS&div=matomo-opt-out&language='.$language.($applyStyling ? '&backgroundColor='.$backgroundColor.'&fontColor='.$fontColor.'&fontSize='.$fontSize.'&fontFamily='.$fontFamily : '').'&showIntro='.($showIntro ? '1' : '0').'"></script>'; +<script src="'.rtrim($matomoUrl, '/').'/index.php?module=CoreAdminHome&action=optOutJS&divId=matomo-opt-out&language='.$language.($applyStyling ? '&backgroundColor='.$backgroundColor.'&fontColor='.$fontColor.'&fontSize='.$fontSize.'&fontFamily='.$fontFamily : '').'&showIntro='.($showIntro ? '1' : '0').'"></script>'; } /** diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index 1188d102c7..6b872abb79 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -317,6 +317,14 @@ class Tasks extends \Piwik\Plugin\Tasks { $url = 'https://raw.githubusercontent.com/matomo-org/referrer-spam-list/master/spammers.txt'; $list = Http::sendHttpRequest($url, 30); + + if (preg_match('/[<>&?"\']/', $list)) { + throw new \Exception(sprintf( + 'The spammers list downloaded from %s contains unexpected characters, considering it a fail', + $url + )); + } + $list = preg_split("/\r\n|\n|\r/", $list); if (count($list) < 10) { throw new \Exception(sprintf( diff --git a/plugins/CoreAdminHome/tests/Framework/Mock/API.php b/plugins/CoreAdminHome/tests/Framework/Mock/API.php index c07af44fc1..a1909f5b61 100644 --- a/plugins/CoreAdminHome/tests/Framework/Mock/API.php +++ b/plugins/CoreAdminHome/tests/Framework/Mock/API.php @@ -14,7 +14,7 @@ class API extends \Piwik\Plugins\CoreAdminHome\API private $invalidatedReports = array(); public function invalidateArchivedReports($idSites, $dates, $period = false, $segment = false, $cascadeDown = false, - $_forceInvalidateNonexistant = false) + $_forceInvalidateNonexistent = false) { $this->invalidatedReports[] = func_get_args(); } |