MDL-77539 blog: null coalesce external blog form name/description.

We can't pass null to most string related functions (e.g. `trim`) in
PHP8.1 onwards.
This commit is contained in:
Paul Holden 2023-03-06 14:49:07 +00:00
parent f49f934786
commit 1818a6841b
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

View File

@ -98,8 +98,8 @@ class blog_edit_external_form extends moodleform {
global $CFG, $COURSE;
$mform =& $this->_form;
$name = trim($mform->getElementValue('name'));
$description = trim($mform->getElementValue('description'));
$name = trim($mform->getElementValue('name') ?? '');
$description = trim($mform->getElementValue('description') ?? '');
$url = $mform->getElementValue('url');
if (empty($name) || empty($description)) {