MDL-46335 backup: fixed casting issue with setting labels
The issue was that clean_param took an int and returned a string and the result was used in an exact comparison. The type change mean the comparison failed. The solution was to ensure the param was cast as a string.
This commit is contained in:
@@ -139,7 +139,8 @@ class base_setting_ui {
|
||||
* @param string $label
|
||||
*/
|
||||
public function set_label($label) {
|
||||
if ((string)$label === '' || $label !== clean_param($label, PARAM_TEXT)) {
|
||||
$label = (string)$label;
|
||||
if ($label === '' || $label !== clean_param($label, PARAM_TEXT)) {
|
||||
throw new base_setting_ui_exception('setting_invalid_ui_label');
|
||||
}
|
||||
$this->label = $label;
|
||||
|
||||
Reference in New Issue
Block a user