<<

Bugzilla::CGI

NAME

Bugzilla::CGI - CGI handling for Bugzilla

SYNOPSIS

  use Bugzilla::CGI;

  my $cgi = new Bugzilla::CGI();

DESCRIPTION

This package inherits from the standard CGI module, to provide additional Bugzilla-specific functionality. In general, see the CGI.pm docs for documention.

CHANGES FROM CGI.PM

Bugzilla::CGI has some differences from CGI.pm.

cgi_error is automatically checked

After creating the CGI object, Bugzilla::CGI automatically checks cgi_error, and throws a CodeError if a problem is detected.

ADDITIONAL FUNCTIONS

Bugzilla::CGI also includes additional functions.

canonicalise_query(@exclude)

This returns a sorted string of the parameters, suitable for use in a url. Values in @exclude are not included in the result.

send_cookie

This routine is identical to the cookie generation part of CGI.pm's cookie routine, except that it knows about Bugzilla's cookie_path and cookie_domain parameters and takes them into account if necessary. This should be used by all Bugzilla code (instead of cookie or the -cookie argument to header), so that under mod_perl the headers can be sent correctly, using print or the mod_perl APIs as appropriate.

To remove (expire) a cookie, use remove_cookie.

remove_cookie

This is a wrapper around send_cookie, setting an expiry date in the past, effectively removing the cookie.

As its only argument, it takes the name of the cookie to expire.

require_https($baseurl)

This routine checks if the current page is being served over https, and redirects to the https protocol if required, retaining QUERY_STRING.

It takes an option argument which will be used as the base URL. If $baseurl is not provided, the current URL is used.

redirect_to_urlbase

Redirects from the current URL to one prefixed by the urlbase parameter.

SEE ALSO

CGI, CGI::Cookie

<<