diff options
author | Stefan Giehl <stefan@matomo.org> | 2022-02-01 11:08:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-01 11:08:31 +0300 |
commit | 4fea439e6530f6779f3de845e2913ce508a83760 (patch) | |
tree | 7b80e54e5f24f8dec406700cad475fe541c573b5 /plugins/Login | |
parent | ce2782827667e4cbf5162cfc7a84bfe657de96d0 (diff) |
Prevent possible error when action is provided as array (#18706)
* Prevent possible error when action is provided as array
* Use Piwik::getModule / Piwik::getAction in a couple more places
* fix test
Diffstat (limited to 'plugins/Login')
-rw-r--r-- | plugins/Login/Login.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/Login/Login.php b/plugins/Login/Login.php index 8b0c299350..df2e740656 100644 --- a/plugins/Login/Login.php +++ b/plugins/Login/Login.php @@ -175,8 +175,8 @@ class Login extends \Piwik\Plugin private function shouldHandleRememberMe() { - $module = Common::getRequestVar('module', false); - $action = Common::getRequestVar('action', false); + $module = Piwik::getModule(); + $action = Piwik::getAction(); return ($module == 'Login' || $module == 'CoreHome') && (empty($action) || $action == 'index' || $action == 'login'); } @@ -221,8 +221,7 @@ class Login extends \Piwik\Plugin $login = StaticContainer::get(\Piwik\Auth::class)->getLogin(); if (empty($login) || $login == 'anonymous') { $login = Common::getRequestVar('form_login', false); - $action = Common::getRequestVar('action', false); - if ($action == 'logme') { + if (Piwik::getAction() === 'logme') { $login = Common::getRequestVar('login', $login); } } |