Skip to content

Commit 75578ae

Browse files
committed
Preventing auto-filling of passwords in config dokuwiki#4362
We previously had set autocomplete="off" on password fields, but browsers seem to ignore that now. MDN suggests [1] to use autocomplete="new-password", so that's what's used now. In addition autocomplete="off" is set on the form as a whole. Will that fix the issue once and for all? Doubtful: > This attribute is a hint to browsers; some may not comply with it. [1] https://developer.mozilla.org/en-US/docs/Web/Security/Practical_implementation_guides/Turning_off_form_autocompletion
1 parent b67cd41 commit 75578ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/plugins/config/admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function html()
9191
// POST to script() instead of wl($ID) so config manager still works if
9292
// rewrite config is broken. Add $ID as hidden field to remember
9393
// current ID in most cases.
94-
echo '<form id="dw__configform" action="' . script() . '" method="post">';
94+
echo '<form id="dw__configform" action="' . script() . '" method="post" autocomplete="off">';
9595
echo '<div class="no"><input type="hidden" name="id" value="' . $ID . '" /></div>';
9696
formSecurityToken();
9797
$this->printH1('dokuwiki_settings', $this->getLang('_header_dokuwiki'));

lib/plugins/config/core/Setting/SettingPassword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function html(\admin_plugin_config $plugin, $echo = false)
3535

3636
$label = '<label for="config___' . $key . '">' . $this->prompt($plugin) . '</label>';
3737
$input = '<input id="config___' . $key . '" name="config[' . $key .
38-
']" autocomplete="off" type="password" class="edit" value="" ' . $disable . ' />';
38+
']" autocomplete="new-password" type="password" class="edit" value="" ' . $disable . ' />';
3939
return [$label, $input];
4040
}
4141
}

0 commit comments

Comments
 (0)