Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
b0c4f9c2
Commit
b0c4f9c2
authored
Dec 04, 2017
by
Damyon Wiese
Browse files
Merge branch 'MDL-36056-master-enrolkeywhitespace' of
git://github.com/mudrd8mz/moodle
parents
d8c1a57b
0c6554e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
lang/en/form.php
View file @
b0c4f9c2
...
...
@@ -41,6 +41,7 @@ $string['err_nopunctuation'] = 'You must enter no punctuation characters here.';
$string
[
'err_numeric'
]
=
'You must enter a number here.'
;
$string
[
'err_rangelength'
]
=
'You must enter between {$a->format[0]} and {$a->format[1]} characters here.'
;
$string
[
'err_required'
]
=
'You must supply a value here.'
;
$string
[
'err_wrappingwhitespace'
]
=
'The value must not start or end with whitespace.'
;
$string
[
'err_wrongfileextension'
]
=
'Some files ({$a->wrongfiles}) cannot be uploaded. Only file types {$a->whitelist} are allowed.'
;
$string
[
'filesofthesetypes'
]
=
'Accepted file types:'
;
$string
[
'filetypesany'
]
=
'All file types'
;
...
...
lib/form/passwordunmask.php
View file @
b0c4f9c2
...
...
@@ -90,4 +90,22 @@ class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password {
return
$context
;
}
/**
* Check that there is no whitespace at the beginning and end of the password.
*
* It turned out that wrapping whitespace can easily be pasted by accident when copying the text from elsewhere.
* Such a mistake is very hard to debug as the whitespace is not displayed.
*
* @param array $value Submitted value.
* @return string|null Validation error message or null.
*/
public
function
validateSubmitValue
(
$value
)
{
if
(
$value
!==
trim
(
$value
))
{
return
get_string
(
'err_wrappingwhitespace'
,
'core_form'
);
}
return
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment