Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e51dc4
)
MDL-36056 forms: Don't validate disabled fields
author
Damyon Wiese
<damyon@moodle.com>
Tue, 5 Dec 2017 01:49:33 +0000
(09:49 +0800)
committer
Jun Pataleta
<jun@moodle.com>
Wed, 6 Dec 2017 06:53:30 +0000
(19:53 +1300)
When fields are disabled, the value comes through as null so we need to specifically check for it
before validation.
lib/form/passwordunmask.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/form/passwordunmask.php
b/lib/form/passwordunmask.php
index
224f756
..
e90ee4d
100644
(file)
--- a/
lib/form/passwordunmask.php
+++ b/
lib/form/passwordunmask.php
@@
-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');
}