Commit b6ddaf98 authored by bugreport%peshkin.net's avatar bugreport%peshkin.net

Bug 282790: Warn if name for a stored query exceeds maximum length

patch by LpSolit r=mkanat,a=justdave
parent 30a52319
...@@ -239,6 +239,7 @@ sub InsertNamedQuery ($$$;$) { ...@@ -239,6 +239,7 @@ sub InsertNamedQuery ($$$;$) {
# Validate the query name. # Validate the query name.
$query_name || ThrowUserError("query_name_missing"); $query_name || ThrowUserError("query_name_missing");
$query_name !~ /[<>&]/ || ThrowUserError("illegal_query_name"); $query_name !~ /[<>&]/ || ThrowUserError("illegal_query_name");
(length($query_name) <= 64) || ThrowUserError("query_name_too_long");
trick_taint($query_name); trick_taint($query_name);
detaint_natural($userid); detaint_natural($userid);
......
...@@ -862,6 +862,10 @@ ...@@ -862,6 +862,10 @@
[% title = "No Search Name Specified" %] [% title = "No Search Name Specified" %]
You must enter a name for your search. 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" %] [% ELSIF error == "quips_disabled" %]
[% title = "Quips Disabled" %] [% title = "Quips Disabled" %]
Quips are disabled. Quips are disabled.
......
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