summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-07-22 05:04:24 +0200
committerlpsolit%gmail.com <>2005-07-22 05:04:24 +0200
commitd0303ab3ecb54eef2ed1b5e55839eada16748416 (patch)
tree3d45f4aaec513824790f8b23983af37b49074563 /CGI.pl
parent69ec0a28fd6b83f7001027dbc60ffa6b8e6b27bb (diff)
downloadbugzilla-d0303ab3ecb54eef2ed1b5e55839eada16748416.tar.gz
bugzilla-d0303ab3ecb54eef2ed1b5e55839eada16748416.tar.xz
Bug 301463: Move CheckFormField and CheckFormFieldDefined into Field.pm - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl43
1 files changed, 0 insertions, 43 deletions
diff --git a/CGI.pl b/CGI.pl
index 9c65efdf2..4b7269358 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -52,49 +52,6 @@ require 'globals.pl';
use vars qw($template $vars);
-# Implementations of several of the below were blatently stolen from CGI.pm,
-# by Lincoln D. Stein.
-
-# check and see if a given field exists, is non-empty, and is set to a
-# legal value. assume a browser bug and abort appropriately if not.
-# if $legalsRef is not passed, just check to make sure the value exists and
-# is non-NULL
-sub CheckFormField ($$;\@) {
- my ($cgi, # a CGI object
- $fieldname, # the fieldname to check
- $legalsRef # (optional) ref to a list of legal values
- ) = @_;
-
- if (!defined $cgi->param($fieldname)
- || trim($cgi->param($fieldname)) eq ""
- || (defined($legalsRef)
- && lsearch($legalsRef, $cgi->param($fieldname))<0))
- {
- SendSQL("SELECT description FROM fielddefs WHERE name=" . SqlQuote($fieldname));
- my $result = FetchOneColumn();
- my $field;
- if ($result) {
- $field = $result;
- }
- else {
- $field = $fieldname;
- }
-
- ThrowCodeError("illegal_field", { field => $field });
- }
-}
-
-# check and see if a given field is defined, and abort if not
-sub CheckFormFieldDefined ($$) {
- my ($cgi, # a CGI object
- $fieldname, # the fieldname to check
- ) = @_;
-
- if (!defined $cgi->param($fieldname)) {
- ThrowCodeError("undefined_field", { field => $fieldname });
- }
-}
-
sub PutHeader {
($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}) = (@_);