From 70194bd699eee0388870aca35b7bdf42b89957da Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 15 May 2005 11:32:15 +0000 Subject: [PATCH] Upgrade to CGI.pm 3.10 p4raw-id: //depot/perl@24470 --- MANIFEST | 1 + lib/CGI.pm | 8 +++++--- lib/CGI/Changes | 7 +++++++ lib/CGI/t/can.t | 12 ++++++++++++ lib/CGI/t/form.t | 30 +++++++++++++++--------------- 5 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 lib/CGI/t/can.t diff --git a/MANIFEST b/MANIFEST index d2f1464..7cf5ec8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1228,6 +1228,7 @@ lib/CGI/Pretty.pm Output nicely formatted HTML lib/CGI/Push.pm Support for server push lib/CGI/Switch.pm Simple interface for multiple server types lib/CGI/t/apache.t See if CGI::Apache still loads +lib/CGI/t/can.t See if CGI.pm works lib/CGI/t/carp.t See if CGI::Carp works lib/CGI/t/cookie.t See if CGI::Cookie works lib/CGI/t/fast.t See if CGI::Fast works (if FCGI is installed) diff --git a/lib/CGI.pm b/lib/CGI.pm index 2346f75..c241562 100644 --- a/lib/CGI.pm +++ b/lib/CGI.pm @@ -18,8 +18,8 @@ use Carp 'croak'; # The most recent version and complete docs are available at: # http://stein.cshl.org/WWW/software/CGI/ -$CGI::revision = '$Id: CGI.pm,v 1.179 2005/04/07 22:40:37 lstein Exp $'; -$CGI::VERSION=3.08; +$CGI::revision = '$Id: CGI.pm,v 1.181 2005/05/13 21:45:26 lstein Exp $'; +$CGI::VERSION='3.10'; # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. @@ -179,11 +179,12 @@ $IIS++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; if (exists $ENV{MOD_PERL}) { # mod_perl handlers may run system() on scripts using CGI.pm; # Make sure so we don't get fooled by inherited $ENV{MOD_PERL} - if ($ENV{MOD_PERL_API_VERSION} == 2) { + if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) { $MOD_PERL = 2; require Apache2::Response; require Apache2::RequestRec; require Apache2::RequestUtil; + require Apache2::RequestIO; require APR::Pool; } else { $MOD_PERL = 1; @@ -888,6 +889,7 @@ sub element_id { sub element_tab { my ($self,$new_value) = self_or_default(@_); + $self->{'.etab'} ||= 1; $self->{'.etab'} = $new_value if defined $new_value; $self->{'.etab'}++; } diff --git a/lib/CGI/Changes b/lib/CGI/Changes index 9b22a52..467ee64 100644 --- a/lib/CGI/Changes +++ b/lib/CGI/Changes @@ -1,3 +1,10 @@ + Version 3.10 + 1. Added Apache2::RequestIO, which is necessary for mp2 interoperability. + + Version 3.09 + 1. Fixed tabindex="0" when using CGI to create forms without a prior start_html + 2. Removed warning about non-numeric MOD_PERL_API_VERSION. + Version 3.08 1. update support for mod_perl 2.0. versions prior to mod_perl 1.999_22 (2.0.0-RC5) are no longer supported. diff --git a/lib/CGI/t/can.t b/lib/CGI/t/can.t new file mode 100644 index 0000000..720eb49 --- /dev/null +++ b/lib/CGI/t/can.t @@ -0,0 +1,12 @@ +#!/usr/local/bin/perl -w + +# Due to a bug in older versions of MakeMaker & Test::Harness, we must +# ensure the blib's are in @INC, else we might use the core CGI.pm + +use lib qw(blib/lib blib/arch); + +use Test::More tests => 2; + +BEGIN{ use_ok('CGI'); } + +can_ok('CGI', qw/cookie param/); \ No newline at end of file diff --git a/lib/CGI/t/form.t b/lib/CGI/t/form.t index 61b6b62..dd8338c 100755 --- a/lib/CGI/t/form.t +++ b/lib/CGI/t/form.t @@ -33,43 +33,43 @@ is(start_form(-action=>'foobar',-method=>'get'), "start_form()"); is(submit(), - qq(), + qq(), "submit()"); is(submit(-name => 'foo', -value => 'bar'), - qq(), + qq(), "submit(-name,-value)"); is(submit({-name => 'foo', -value => 'bar'}), - qq(), + qq(), "submit({-name,-value})"); is(textfield(-name => 'weather'), - qq(), + qq(), "textfield({-name})"); is(textfield(-name => 'weather', -value => 'nice'), - qq(), + qq(), "textfield({-name,-value})"); is(textfield(-name => 'weather', -value => 'nice', -override => 1), - qq(), + qq(), "textfield({-name,-value,-override})"); is(checkbox(-name => 'weather', -value => 'nice'), - qq(), + qq(), "checkbox()"); is(checkbox(-name => 'weather', -value => 'nice', -label => 'forecast'), - qq(), + qq(), "checkbox()"); is(checkbox(-name => 'weather', @@ -77,41 +77,41 @@ is(checkbox(-name => 'weather', -label => 'forecast', -checked => 1, -override => 1), - qq(), + qq(), "checkbox()"); is(checkbox(-name => 'weather', -value => 'dull', -label => 'forecast'), - qq(), + qq(), "checkbox()"); is(radio_group(-name => 'game'), - qq( ), + qq( ), 'radio_group()'); is(radio_group(-name => 'game', -labels => {'chess' => 'ping pong'}), - qq( ), + qq( ), 'radio_group()'); is(checkbox_group(-name => 'game', -Values => [qw/checkers chess cribbage/]), - qq( ), + qq( ), 'checkbox_group()'); is(checkbox_group(-name => 'game', '-values' => [qw/checkers chess cribbage/], '-defaults' => ['cribbage'], -override=>1), - qq( ), + qq( ), 'checkbox_group()'); is(popup_menu(-name => 'game', '-values' => [qw/checkers chess cribbage/], -default => 'cribbage', -override => 1), - ' -- 2.7.4