From a8266e2f1c3a36a5e6642f314a24f152be7d479e Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 17 Jul 2014 12:52:18 +1200 Subject: [PATCH] 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. --- backup/util/ui/backup_ui_setting.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backup/util/ui/backup_ui_setting.class.php b/backup/util/ui/backup_ui_setting.class.php index 9ef58656a24..1712a7359a8 100644 --- a/backup/util/ui/backup_ui_setting.class.php +++ b/backup/util/ui/backup_ui_setting.class.php @@ -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; -- 2.43.0