From cd7fb950de62f5661b3a3014f285f1b2cdbb5153 Mon Sep 17 00:00:00 2001 From: raortegar Date: Mon, 2 Dec 2024 13:10:09 +0100 Subject: [PATCH] MDL-83835 lib: PEAR - passing null to str functions is deprecated --- lib/pear/HTML/QuickForm/hierselect.php | 2 +- lib/pear/readme_moodle.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pear/HTML/QuickForm/hierselect.php b/lib/pear/HTML/QuickForm/hierselect.php index 1bce43b6e7a..89376a27644 100644 --- a/lib/pear/HTML/QuickForm/hierselect.php +++ b/lib/pear/HTML/QuickForm/hierselect.php @@ -496,7 +496,7 @@ JAVASCRIPT; $ret = parent::onQuickFormEvent($event, $arg, $caller); // add onreset handler to form to properly reset hierselect (see bug #2970) if ('addElement' == $event) { - $onReset = $caller->getAttribute('onreset'); + $onReset = $caller->getAttribute('onreset') ?? ''; if (strlen($onReset)) { if (strpos($onReset, '_hs_setupOnReset')) { $caller->updateAttributes(array('onreset' => str_replace('_hs_setupOnReset(this, [', "_hs_setupOnReset(this, ['" . $this->_escapeString($this->getName()) . "', ", $onReset))); diff --git a/lib/pear/readme_moodle.txt b/lib/pear/readme_moodle.txt index ff0ab2da5d2..9c10c9ffbd6 100644 --- a/lib/pear/readme_moodle.txt +++ b/lib/pear/readme_moodle.txt @@ -32,7 +32,7 @@ MDL-70457 - PHP 7.4 curly brackets string access fix. MDL-71126 - Quiz: Manual grading page size preference can get stuck at 0 Including in this change: - New positiveint regex rule to check if the value is a positive integer -MDL-76102 / MDL-77081 +MDL-76102 / MDL-77081 / MDL-83835 PHP 8.1 passing null to a non-nullable argument of a built-in function is deprecated MDL-77164 - PHPdocs corrections MDL-78145 - PHP 8.2 compliance. Added a missing class property that still need to be declared