Dzahn has submitted this change and it was merged.

Change subject: Reset tops parameter to default value if too long
......................................................................


Reset tops parameter to default value if too long

If the "tops" URL parameter exceeds 20 characters it is turned
into a logarithmic expression which also includes letters and
hence makes the query fail which expects numbers only.

Reported by Jakub Galczyk.

Change-Id: I3fb34eecda203aa900430730bee5075c683c61e1
---
M extensions/WeeklyReport/weekly-bug-summary.cgi
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Aklapper: Looks good to me, but someone else must approve
  Dzahn: Verified; Looks good to me, approved



diff --git a/extensions/WeeklyReport/weekly-bug-summary.cgi 
b/extensions/WeeklyReport/weekly-bug-summary.cgi
index f1649ed..76388c1 100755
--- a/extensions/WeeklyReport/weekly-bug-summary.cgi
+++ b/extensions/WeeklyReport/weekly-bug-summary.cgi
@@ -346,6 +346,11 @@
 my $current_tops = 20;
 $current_tops = $cgi->param('tops') if (defined $cgi->param('tops'));
 $current_tops = 20 if (!detaint_natural($current_tops));
+
+# Reset tops parameter to default if very long
+my $length_cgi_tops = length ($cgi->param('tops'));
+$current_tops = 20 if ($length_cgi_tops > 15);
+
 $defaults{'tops'} = $current_tops;
 
 $vars->{'duration'} = $current_days;

-- 
To view, visit https://gerrit.wikimedia.org/r/96880
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3fb34eecda203aa900430730bee5075c683c61e1
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Aklapper <[email protected]>
Gerrit-Reviewer: Aklapper <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to