Aklapper has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96880
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(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications
refs/changes/80/96880/1
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: newchange
Gerrit-Change-Id: I3fb34eecda203aa900430730bee5075c683c61e1
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Aklapper <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits