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.
* @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;