X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCGI.pm;h=a53fbb51444b8cb95fd133bd0c5123eb0b23cf1d;hb=fd20da51661b685c54940aeb116a97beabf44d0f;hp=78bc931466a1aebadd0e82c21b9fb7d2faf91541;hpb=5cb3728cfe288ad05e8d10c8176f72378da2238f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/CGI.pm b/lib/CGI.pm index 78bc931..a53fbb5 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.58 2002/01/12 02:44:56 lstein Exp $'; -$CGI::VERSION='2.80'; +$CGI::revision = '$Id: CGI.pm,v 1.62 2002/04/10 19:36:01 lstein Exp $'; +$CGI::VERSION='2.81'; # HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES. # UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING. @@ -220,8 +220,8 @@ sub import { my $self = shift; # This causes modules to clash. -# undef %EXPORT_OK; -# undef %EXPORT; + undef %EXPORT_OK; + undef %EXPORT; $self->_setup_symbols(@_); my ($callpack, $callfile, $callline) = caller; @@ -552,6 +552,7 @@ sub parse_params { my($param,$value); foreach (@pairs) { ($param,$value) = split('=',$_,2); + next unless defined $param; next if $NO_UNDEF_PARAMS and not defined $value; $value = '' unless defined $value; $param = unescape($param); @@ -677,6 +678,10 @@ sub _reset_globals { initialize_globals(); } sub _setup_symbols { my $self = shift; my $compile = 0; + + # to avoid reexporting unwanted variables + undef %EXPORT; + foreach (@_) { $HEADERS_ONCE++, next if /^[:-]unique_headers$/; $NPH++, next if /^[:-]nph$/; @@ -1331,7 +1336,7 @@ sub start_html { $target,$meta,$head,$style,$dtd,$lang,$encoding,@other) = rearrange([TITLE,AUTHOR,BASE,XBASE,SCRIPT,NOSCRIPT,TARGET,META,HEAD,STYLE,DTD,LANG,ENCODING],@p); - $encoding = 'utf-8' unless defined $encoding; + $encoding = 'iso-8859-1' unless defined $encoding; # strangely enough, the title needs to be escaped as HTML # while the author needs to be escaped as a URL @@ -1354,7 +1359,7 @@ sub start_html { push @result,qq() if $xml_dtd; if (ref($dtd) && ref($dtd) eq 'ARRAY') { - push(@result,qq([0]"\n\tSYSTEM "$dtd->[1]">)); + push(@result,qq([0]"\n\t "$dtd->[1]">)); } else { push(@result,qq()); } @@ -1418,7 +1423,7 @@ sub _style { foreach $src (@$src) { push(@result,$XHTML ? qq() - : qq(/)) if $src; + : qq()) if $src; } } else @@ -1612,7 +1617,7 @@ sub _textfield { # and WebTV -- not sure it won't break stuff my($value) = $current ne '' ? qq(value="$current") : ''; return $XHTML ? qq() - : qq//; + : qq(); } END_OF_FUNC @@ -1727,7 +1732,7 @@ sub button { $script = qq/ onclick="$script"/ if $script; my($other) = @other ? " @other" : ''; return $XHTML ? qq() - : qq//; + : qq(); } END_OF_FUNC @@ -1757,7 +1762,7 @@ sub submit { $val = qq/ value="$value"/ if defined($value); my($other) = @other ? " @other" : ''; return $XHTML ? qq() - : qq//; + : qq(); } END_OF_FUNC @@ -1777,7 +1782,7 @@ sub reset { my($value) = defined($label) ? qq/ value="$label"/ : ''; my($other) = @other ? " @other" : ''; return $XHTML ? qq() - : qq//; + : qq(); } END_OF_FUNC @@ -4423,7 +4428,7 @@ English. For example: print $q->start_html(-lang=>'fr-CA'); The B<-encoding> argument can be used to specify the character set for -XHTML. It defaults to UTF-8 if not specified. +XHTML. It defaults to iso-8859-1 if not specified. You can place other arbitrary HTML elements to the section with the B<-head> tag. For example, to place the rarely-used element in the @@ -6684,9 +6689,7 @@ warnings when programs are run with the B<-w> switch. =head1 SEE ALSO -L, L, L, L, -L, L, L, L, -L +L, L, L =cut