Commit 72bc89ef authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 851267: Bugzilla times out when a user has several thousands of votes

r=dkl a=justdave
parent 2083d285
...@@ -466,9 +466,9 @@ sub redirect_search_url { ...@@ -466,9 +466,9 @@ sub redirect_search_url {
# GET requests that lacked a list_id are always redirected. POST requests # GET requests that lacked a list_id are always redirected. POST requests
# are only redirected if they're under the CGI_URI_LIMIT though. # are only redirected if they're under the CGI_URI_LIMIT though.
my $uri_length = length($self->self_url()); my $self_url = $self->self_url();
if ($self->request_method() ne 'POST' or $uri_length < CGI_URI_LIMIT) { if ($self->request_method() ne 'POST' or length($self_url) < CGI_URI_LIMIT) {
print $self->redirect(-url => $self->self_url()); print $self->redirect(-url => $self_url);
exit; exit;
} }
} }
...@@ -522,7 +522,7 @@ sub url_is_attachment_base { ...@@ -522,7 +522,7 @@ sub url_is_attachment_base {
$regex =~ s/\\\%bugid\\\%/\\d+/; $regex =~ s/\\\%bugid\\\%/\\d+/;
} }
$regex = "^$regex"; $regex = "^$regex";
return ($self->self_url =~ $regex) ? 1 : 0; return ($self->url =~ $regex) ? 1 : 0;
} }
########################## ##########################
......
...@@ -95,8 +95,7 @@ ...@@ -95,8 +95,7 @@
</tr> </tr>
[% FOREACH bug = product.bugs %] [% FOREACH bug = product.bugs %]
<tr [% IF bug.id == this_bug.id && canedit %] <tr [% IF bug.id == this_bug.id && canedit %] class="bz_bug_being_voted_on"[% END %]>
class="bz_bug_being_voted_on" [% END %]>
<td> <td>
[% IF bug.id == this_bug.id && canedit %] [% IF bug.id == this_bug.id && canedit %]
[% IF product.onevoteonly %] [% IF product.onevoteonly %]
...@@ -106,25 +105,25 @@ ...@@ -106,25 +105,25 @@
[% END %] [% END %]
[%- END %] [%- END %]
</td> </td>
<td align="right"><a name="vote_[% bug.id FILTER html %]"> <td align="right"><a name="vote_[% bug.id FILTER none %]">
[% IF canedit %] [% IF canedit %]
[% IF product.onevoteonly %] [% IF product.onevoteonly %]
<input type="checkbox" name="[% bug.id FILTER html %]" value="1" <input type="checkbox" name="[% bug.id FILTER none %]" value="1"
[% " checked" IF bug.count %] id="bug_[% bug.id FILTER html %]"> [% " checked" IF bug.count %] id="bug_[% bug.id FILTER none %]">
[% ELSE %] [% ELSE %]
<input name="[% bug.id FILTER html %]" value="[% bug.count FILTER html %]" <input name="[% bug.id FILTER none %]" value="[% bug.count FILTER html %]"
size="2" id="bug_[% bug.id FILTER html %]"> size="2" id="bug_[% bug.id FILTER none %]">
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% bug.count FILTER html %] [% bug.count FILTER html %]
[% END %] [% END %]
</a></td> </a></td>
<td align="center"> <td align="center">
[% bug.id FILTER bug_link(bug) FILTER none %] [% PROCESS bug/link.html.tmpl bug = bug, link_text = bug.id %]
</td> </td>
<td> <td>
[% bug.summary FILTER html %] [% bug.short_desc FILTER html %]
(<a href="page.cgi?id=voting/bug.html&amp;bug_id=[% bug.id FILTER uri %]">Show Votes</a>) (<a href="page.cgi?id=voting/bug.html&amp;bug_id=[% bug.id FILTER none %]">Show Votes</a>)
</td> </td>
</tr> </tr>
[% END %] [% END %]
......
Markdown is supported
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