MDL-76102 lib: PEAR - passing null to str functions is deprecated

This commit is contained in:
Marina Glancy
2022-10-27 07:36:26 +02:00
parent 35f39c45b7
commit 4b99c6a795
5 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -351,7 +351,7 @@ class HTML_QuickForm_element extends HTML_Common
if (empty($values)) {
return null;
}
$elementName = $this->getName();
$elementName = $this->getName() ?? '';
if (isset($values[$elementName])) {
return $values[$elementName];
} elseif (strpos($elementName, '[')) {
@@ -447,7 +447,7 @@ class HTML_QuickForm_element extends HTML_Common
return;
}
$id = $this->getName();
$id = $this->getName() ?? '';
$id = 'id_' . str_replace(array('qf_', '[', ']'), array('', '_', ''), $id);
$id = clean_param($id, PARAM_ALPHANUMEXT);
$this->updateAttributes(array('id' => $id));