Permalink
Browse files

Merge branch 'w03_MDL-31213_m20_attributesmess' of git://github.com/s…

…kodak/moodle into MOODLE_20_STABLE
  • Loading branch information...
stronk7 committed Jan 17, 2012
2 parents dcbd731 + e8848eb commit ca58cd28b00d2ca8bc72881c5886dcc122108c43
Showing with 21 additions and 6 deletions.
  1. +7 −2 lib/form/password.php
  2. +7 −2 lib/form/passwordunmask.php
  3. +7 −2 lib/formslib.php
View
@@ -19,9 +19,14 @@ function MoodleQuickForm_password($elementName=null, $elementLabel=null, $attrib
if (empty($CFG->xmlstrictheaders)) {
// no standard mform in moodle should allow autocomplete of passwords
// this is valid attribute in html5, sorry, we have to ignore validation errors in legacy xhtml 1.0
$attributes = (array)$attributes;
if (!isset($attributes['autocomplete'])) {
if (empty($attributes)) {
$attributes = array('autocomplete'=>'off');
} else if (is_array($attributes)) {
$attributes['autocomplete'] = 'off';
} else {
if (strpos($attributes, 'autocomplete') === false) {
$attributes .= ' autocomplete="off" ';
}
}
}
@@ -19,9 +19,14 @@ function MoodleQuickForm_passwordunmask($elementName=null, $elementLabel=null, $
if (empty($CFG->xmlstrictheaders)) {
// no standard mform in moodle should allow autocomplete of passwords
// this is valid attribute in html5, sorry, we have to ignore validation errors in legacy xhtml 1.0
$attributes = (array)$attributes;
if (!isset($attributes['autocomplete'])) {
if (empty($attributes)) {
$attributes = array('autocomplete'=>'off');
} else if (is_array($attributes)) {
$attributes['autocomplete'] = 'off';
} else {
if (strpos($attributes, 'autocomplete') === false) {
$attributes .= ' autocomplete="off" ';
}
}
}
parent::MoodleQuickForm_password($elementName, $elementLabel, $attributes);
View
@@ -143,9 +143,14 @@ function moodleform($action=null, $customdata=null, $method='post', $target='',
if (empty($CFG->xmlstrictheaders)) {
// no standard mform in moodle should allow autocomplete with the exception of user signup
// this is valid attribute in html5, sorry, we have to ignore validation errors in legacy xhtml 1.0
$attributes = (array)$attributes;
if (!isset($attributes['autocomplete'])) {
if (empty($attributes)) {
$attributes = array('autocomplete'=>'off');
} else if (is_array($attributes)) {
$attributes['autocomplete'] = 'off';
} else {
if (strpos($attributes, 'autocomplete') === false) {
$attributes .= ' autocomplete="off" ';
}
}
}

0 comments on commit ca58cd2

Please sign in to comment.