From: Jarkko Hietaniemi Date: Fri, 11 Jan 2002 14:51:11 +0000 (+0000) Subject: Upgrade to CGI.pm 2.79. Manual tweaks were X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3acbd4f53b544ab36759ef8cf0a6fcc4f696a8d0;p=p5sagit%2Fp5-mst-13.2.git Upgrade to CGI.pm 2.79. Manual tweaks were necessary in form.t and html.t @INC setups. p4raw-id: //depot/perl@14189 --- diff --git a/lib/CGI.pm b/lib/CGI.pm index 6ad0191..292e262 100644 --- a/lib/CGI.pm +++ b/lib/CGI.pm @@ -18,16 +18,19 @@ 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.55 2001/09/26 02:15:52 lstein Exp $'; -$CGI::VERSION='2.78'; +$CGI::revision = '$Id: CGI.pm,v 1.56 2001/12/09 21:36:23 lstein Exp $'; +$CGI::VERSION='2.79'; # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. # $CGITempFile::TMPDIRECTORY = '/usr/tmp'; use CGI::Util qw(rearrange make_attributes unescape escape expires); -use constant XHTML_DTD => ['-//W3C//DTD XHTML Basic 1.0//EN', - 'http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd']; +#use constant XHTML_DTD => ['-//W3C//DTD XHTML Basic 1.0//EN', +# 'http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd']; + +use constant XHTML_DTD => ['-//W3C//DTD XHTML 1.0 Transitional//EN', + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd']; # >>>>> Here are some globals that you might want to adjust <<<<<< sub initialize_globals { @@ -188,6 +191,9 @@ if ($needs_binmode) { input Select option comment charset escapeHTML/], ':html3'=>[qw/div table caption th td TR Tr sup Sub strike applet Param embed basefont style span layer ilayer font frameset frame script small big/], + ':html4'=>[qw/abbr acronym bdo col colgroup del fieldset iframe + ins label legend noframes noscript object optgroup Q + thead tbody tfoot/], ':netscape'=>[qw/blink fontsize center/], ':form'=>[qw/textfield textarea filefield password_field hidden checkbox checkbox_group submit reset defaults radio_group popup_menu button autoEscape @@ -203,10 +209,10 @@ if ($needs_binmode) { ':ssl' => [qw/https/], ':imagemap' => [qw/Area Map/], ':cgi-lib' => [qw/ReadParse PrintHeader HtmlTop HtmlBot SplitParam Vars/], - ':html' => [qw/:html2 :html3 :netscape/], - ':standard' => [qw/:html2 :html3 :form :cgi/], + ':html' => [qw/:html2 :html3 :html4 :netscape/], + ':standard' => [qw/:html2 :html3 :html4 :form :cgi/], ':push' => [qw/multipart_init multipart_start multipart_end multipart_final/], - ':all' => [qw/:html2 :html3 :netscape :form :cgi :internal/] + ':all' => [qw/:html2 :html3 :netscape :form :cgi :internal :html4/] ); # to import symbols into caller @@ -652,6 +658,20 @@ sub _compile { return "$pack\:\:$func_name"; } +sub _selected { + my $self = shift; + my $value = shift; + return '' unless $value; + return $XHTML ? qq( selected="1") : qq( selected); +} + +sub _checked { + my $self = shift; + my $value = shift; + return '' unless $value; + return $XHTML ? qq( checked="1") : qq( checked); +} + sub _reset_globals { initialize_globals(); } sub _setup_symbols { @@ -1021,20 +1041,20 @@ END_OF_FUNC sub Dump { my($self) = self_or_default(@_); my($param,$value,@result); - return '' unless $self->param; - push(@result,""); return join("\n",@result); } END_OF_FUNC @@ -1298,11 +1318,11 @@ END_OF_FUNC # $script -> (option) Javascript code (-script) # $no_script -> (option) Javascript