From a7fce39b789e282b8d786fd231633056eacd2c6c Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" Date: Sun, 20 Feb 2005 17:15:14 +0000 Subject: [PATCH] Bug 282790: Warn if name for a stored query exceeds maximum length patch by LpSolit r=mkanat,a=justdave git-svn-id: svn://10.0.0.236/trunk@169532 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/buglist.cgi | 1 + .../bugzilla/template/en/default/global/user-error.html.tmpl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/mozilla/webtools/bugzilla/buglist.cgi b/mozilla/webtools/bugzilla/buglist.cgi index 4b9bc960f16..fd01f10d5fa 100755 --- a/mozilla/webtools/bugzilla/buglist.cgi +++ b/mozilla/webtools/bugzilla/buglist.cgi @@ -239,6 +239,7 @@ sub InsertNamedQuery ($$$;$) { # Validate the query name. $query_name || ThrowUserError("query_name_missing"); $query_name !~ /[<>&]/ || ThrowUserError("illegal_query_name"); + (length($query_name) <= 64) || ThrowUserError("query_name_too_long"); trick_taint($query_name); detaint_natural($userid); diff --git a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl index ac2cba6d3c9..55c7969242e 100644 --- a/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/global/user-error.html.tmpl @@ -862,6 +862,10 @@ [% title = "No Search Name Specified" %] You must enter a name for your search. + [% ELSIF error == "query_name_too_long" %] + [% title = "Query Name Too Long" %] + The name of the query must be less than 64 characters long. + [% ELSIF error == "quips_disabled" %] [% title = "Quips Disabled" %] Quips are disabled.