From 5d55b2031e2d1b0e51e50088c301215e471d137f Mon Sep 17 00:00:00 2001 From: Altamash Shaikh Date: Tue, 21 Jul 2026 14:37:46 +0530 Subject: [PATCH] Add strict comparison check --- CHANGELOG.md | 1 + CustomAlerts.php | 2 +- Validator.php | 2 +- plugin.json | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08b6008..436685a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Changelog +* 5.3.3 - 2026-07-27 - Added strict comparison check * 5.3.2 - 2026-06-29 - Added code to improve the access check before sending an alert * 5.3.1 - 2026-06-08 - Added restrict access check for MultiSites.getAll report for non superusers * 5.3.0 - 2026-05-11 - Added alert description and helptexts diff --git a/CustomAlerts.php b/CustomAlerts.php index 177cdbf..319db7d 100755 --- a/CustomAlerts.php +++ b/CustomAlerts.php @@ -112,7 +112,7 @@ public function deleteAlertsForLogin($userLogin) $alerts = $this->getAllAlerts(); foreach ($alerts as $alert) { - if ($alert['login'] == $userLogin) { + if ((string) $alert['login'] === (string) $userLogin) { $model->deleteAlert($alert['idalert']); } } diff --git a/Validator.php b/Validator.php index ea9bc48..36dcd6a 100755 --- a/Validator.php +++ b/Validator.php @@ -181,7 +181,7 @@ public function checkApiMethodAndMetric($idSite, $apiMethodUniqueId, $metric) */ public function checkUserHasPermissionForAlert($alert) { - if (Piwik::getCurrentUserLogin() != $alert['login']) { + if ((string) Piwik::getCurrentUserLogin() !== (string) $alert['login']) { throw new Exception(Piwik::translate('CustomAlerts_AccessException', $alert['idalert'])); } } diff --git a/plugin.json b/plugin.json index 3aebc79..736f16a 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "name": "CustomAlerts", "description": "Create custom Alerts to be notified of important changes on your website or app! ", - "version": "5.3.2", + "version": "5.3.3", "require": { "matomo": ">=5.0.0-b1,<6.0.0-b1" },