mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
Merge branch 'MDL-52952-master' of https://github.com/xow/moodle
This commit is contained in:
commit
3a0b30c7c7
2 changed files with 3 additions and 5 deletions
|
@ -189,10 +189,6 @@ abstract class moodleform {
|
|||
$this->_form->hardFreeze();
|
||||
}
|
||||
|
||||
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
|
||||
$element = $this->_form->addElement('hidden');
|
||||
$element->setType('password');
|
||||
|
||||
$this->definition();
|
||||
|
||||
$this->_form->addElement('hidden', 'sesskey', null); // automatic sesskey protection
|
||||
|
@ -2703,6 +2699,8 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
|
|||
$this->_collapseButtons = '';
|
||||
$formid = $form->getAttribute('id');
|
||||
parent::startForm($form);
|
||||
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
|
||||
$this->_hiddenHtml .= prevent_form_autofill_password();
|
||||
if ($form->isFrozen()){
|
||||
$this->_formTemplate = "\n<div class=\"mform frozen\">\n{content}\n</div>";
|
||||
} else {
|
||||
|
|
|
@ -3662,5 +3662,5 @@ function get_formatted_help_string($identifier, $component, $ajax = false, $a =
|
|||
* @return string HTML to prevent password autofill
|
||||
*/
|
||||
function prevent_form_autofill_password() {
|
||||
return '<div class="hide"><input type="password" /></div>';
|
||||
return '<div class="hide"><input type="text" /><input type="password" /></div>';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue