Unverified Commit f4c3d9f5 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #1114 from ikedas/issue-1033_trial1 by ikedas

Add autocomplete="off" to all forms unless explicitly enabled.
parents 98999a6b 92bafad4
......@@ -63,7 +63,7 @@
[% END ~%]
[% IF use_passwd ~%]
<form action="[% path_cgi %]" method="post">
<form action="[% path_cgi %]" method="post" autocomplete="on">
<fieldset>
<input type="hidden" name="previous_action" value="[% previous_action %]" />
<input type="hidden" name="previous_list" value="[% previous_list %]" />
......
......@@ -42,7 +42,7 @@
[% END %]
[% END %]
[% IF SAFE_TO_REVEAL_EMAIL %]
<form class="bold_label" action="[% path_cgi %]" method="post">
<form class="bold_label" action="[% path_cgi %]" method="post" autocomplete="on">
<fieldset>
<input type="hidden" name="previous_action" value="[% previous_action %]" />
<input type="hidden" name="previous_list" value="[% previous_list %]" />
......
......@@ -2471,6 +2471,16 @@ sub send_html {
$beg . $content . $end;
}egisx;
}
# Add autocomplete="off" to all forms unless explicitly enabled.
$output =~ s{
<form ( \s+ [^>]*? /? ) >
}{
my $attrs = $1;
$attrs =~ s/(\s*\/?)\z/ autocomplete="off"$1/
unless $attrs =~ /\sautocomplete="[^"]*"/i;
"<form$attrs>";
}egisx;
print $output;
}
 
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment