From 0f10c17efc29c092f9764117c11fe14043c3c81c Mon Sep 17 00:00:00 2001 From: Noemie Ariste Date: Mon, 30 Oct 2023 13:08:33 +1300 Subject: [PATCH] resolve php7.4+ error in unit tests --- classes/redirect_rule.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/redirect_rule.php b/classes/redirect_rule.php index 72e335b..a3ca1bc 100644 --- a/classes/redirect_rule.php +++ b/classes/redirect_rule.php @@ -152,7 +152,11 @@ public function noredirect_param_is_set() { // This is needed to support vanity urls which don't exist via the error handler. $url = new \moodle_url($FULLME); - $raw = clean_param($url->param(self::NO_REDIRECT_PARAM), PARAM_BOOL); + $raw = false; + + if (!empty($param) && !empty($FULLME)) { + $raw = clean_param($url->param(self::NO_REDIRECT_PARAM), PARAM_BOOL); + } return $param || $raw; }