MDL-77462 core_question: avoid passing null to preg_match
This commit is contained in:
+1
-1
@@ -1982,7 +1982,7 @@ function core_question_find_next_unused_idnumber(?string $oldidnumber, int $cate
|
||||
global $DB;
|
||||
|
||||
// The the old idnumber is not of the right form, bail now.
|
||||
if (!preg_match('~\d+$~', $oldidnumber, $matches)) {
|
||||
if ($oldidnumber === null || !preg_match('~\d+$~', $oldidnumber, $matches)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user