MDL-36056 forms: Don't validate disabled fields

When fields are disabled, the value comes through as null so we need to specifically check for it
before validation.
This commit is contained in:
Damyon Wiese 2017-12-05 09:49:33 +08:00 committed by Jun Pataleta
parent 9e51dc406f
commit 387f7aae0d

View File

@ -101,8 +101,7 @@ class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password {
* @return string|null Validation error message or null.
*/
public function validateSubmitValue($value) {
if ($value !== trim($value)) {
if ($value !== null && $value !== trim($value)) {
return get_string('err_wrappingwhitespace', 'core_form');
}