Permalink
Browse files

Combat Chrome's insanely aggressive user/pass autofilling ಠ_ಠ

Chrome now ignores `autocomplete="off"` in <input>, so this hack uses
a hidden, non-named, non-empty input, right before the password field.

see #24364. props azaozz, nacin, bobbingwide, aaroncampbell.

git-svn-id: http://core.svn.wordpress.org/trunk@24552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 5b8aad1 commit bd94dc655c8047da6fa3330e800bc4d3bd5f3440 @markjaquith markjaquith committed Jul 3, 2013
Showing with 2 additions and 0 deletions.
  1. +1 −0 wp-admin/user-edit.php
  2. +1 −0 wp-admin/user-new.php
View
@@ -377,6 +377,7 @@ function use_ssl_preference($user) {
<tr id="password">
<th><label for="pass1"><?php _e('New Password'); ?></label></th>
<td>
+ <input class="hidden" value=" " /><!-- #24364 workaround -->
<input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("If you would like to change the password type a new one. Otherwise leave this blank."); ?></span>
</td>
</tr>
View
@@ -342,6 +342,7 @@ function admin_created_user_subject( $text ) {
<tr class="form-field form-required">
<th scope="row"><label for="pass1"><?php _e('Password'); ?> <span class="description"><?php /* translators: password input field */_e('(required)'); ?></span></label></th>
<td>
+ <input class="hidden" value=" " /><!-- #24364 workaround -->
<input name="pass1" type="password" id="pass1" autocomplete="off" />
</td>
</tr>

0 comments on commit bd94dc6

Please sign in to comment.