Permalink
Browse files

This is version 2.52

  • Loading branch information...
1 parent 85030c9 commit 9feab8de6731823172f69a2d9c1c6b4e756ad30d lstein committed Jun 8, 1999
Showing with 97 additions and 42 deletions.
  1. +6 −4 ANNOUNCE
  2. +55 −19 CGI.pm
  3. +17 −9 CGI/Carp.pm
  4. +4 −4 CGI/Cookie.pm
  5. +15 −6 cgi_docs.html
View
@@ -1,11 +1,13 @@
-CGI.pm version 2.51 is now available for your fun and edification.
+CGI.pm version 2.52 is now available for your fun and edification.
This version includes the following bug fixes and features:
-1. Patch to fix cookie setting problems with IE 5.0 (and maybe Netscape 5.0)
-2. Documentation fixes.
+1. VMS and DOS fixes
+2. More cookie fixes
+3. Linebreaks supported in dump routine
+4. spurious newline removed from checkbox().
Lincoln Stein
-5/3/99
+6/8/99
========================================================================
Lincoln D. Stein
View
@@ -17,8 +17,8 @@ require 5.004;
# The most recent version and complete docs are available at:
# http://stein.cshl.org/WWW/software/CGI/
-$CGI::revision = '$Id: CGI.pm,v 1.16 1999-05-03 18:08:11 lstein Exp $';
-$CGI::VERSION='2.51';
+$CGI::revision = '$Id: CGI.pm,v 1.17 1999-06-08 15:06:22 lstein Exp $';
+$CGI::VERSION='2.52';
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
@@ -58,6 +58,9 @@ sub initialize_globals {
# Change this to 1 to disable uploads entirely:
$DISABLE_UPLOADS = 0;
+ # Automatically determined -- don't change
+ $EBCDIC = 0;
+
# Change this to 1 to suppress redundant HTTP headers
$HEADERS_ONCE = 0;
@@ -89,9 +92,11 @@ unless ($OS) {
}
}
if ($OS=~/Win/i) {
- $OS = 'WINDOWS';
+ $OS = 'WINDOWS';
} elsif ($OS=~/vms/i) {
- $OS = 'VMS';
+ $OS = 'VMS';
+} elsif ($OS=~/dos/i) {
+ $OS = 'DOS';
} elsif ($OS=~/^MacOS$/i) {
$OS = 'MACINTOSH';
} elsif ($OS=~/os2/i) {
@@ -101,7 +106,7 @@ if ($OS=~/Win/i) {
}
# Some OS logic. Binary mode enabled on DOS, NT and VMS
-$needs_binmode = $OS=~/^(WINDOWS|VMS|OS2)/;
+$needs_binmode = $OS=~/^(WINDOWS|DOS|OS2|MSWin)/;
# This is the default class for the CGI object to use when all else fails.
$DefaultClass = 'CGI' unless defined $CGI::DefaultClass;
@@ -112,7 +117,7 @@ $AutoloadClass = $DefaultClass unless defined $CGI::AutoloadClass;
# The path separator is a slash, backslash or semicolon, depending
# on the paltform.
$SL = {
- UNIX=>'/', OS2=>'\\', WINDOWS=>'\\', MACINTOSH=>':', VMS=>'/'
+ UNIX=>'/', OS2=>'\\', WINDOWS=>'\\', DOS=>'\\', MACINTOSH=>':', VMS=>'/'
}->{$OS};
# This no longer seems to be necessary
@@ -139,11 +144,32 @@ $PERLEX++ if defined($ENV{'GATEWAY_INTERFACE'}) && $ENV{'GATEWAY_INTERFACE'} =~
# really annoying.
$EBCDIC = "\t" ne "\011";
if ($OS eq 'VMS') {
- $CRLF = "\n";
+ $CRLF = "\n";
} elsif ($EBCDIC) {
- $CRLF= "\r\n";
+ $CRLF= "\r\n";
} else {
- $CRLF = "\015\012";
+ $CRLF = "\015\012";
+}
+
+if ($EBCDIC) {
+@A2E = (
+ 0, 1, 2, 3, 55, 45, 46, 47, 22, 5, 21, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 60, 61, 50, 38, 24, 25, 63, 39, 28, 29, 30, 31,
+ 64, 90,127,123, 91,108, 80,125, 77, 93, 92, 78,107, 96, 75, 97,
+240,241,242,243,244,245,246,247,248,249,122, 94, 76,126,110,111,
+124,193,194,195,196,197,198,199,200,201,209,210,211,212,213,214,
+215,216,217,226,227,228,229,230,231,232,233,173,224,189, 95,109,
+121,129,130,131,132,133,134,135,136,137,145,146,147,148,149,150,
+151,152,153,162,163,164,165,166,167,168,169,192, 79,208,161, 7,
+ 32, 33, 34, 35, 36, 37, 6, 23, 40, 41, 42, 43, 44, 9, 10, 27,
+ 48, 49, 26, 51, 52, 53, 54, 8, 56, 57, 58, 59, 4, 20, 62,255,
+ 65,170, 74,177,159,178,106,181,187,180,154,138,176,202,175,188,
+144,143,234,250,190,160,182,179,157,218,155,139,183,184,185,171,
+100,101, 98,102, 99,103,158,104,116,113,114,115,120,117,118,119,
+172,105,237,238,235,239,236,191,128,253,254,251,252,186,174, 89,
+ 68, 69, 66, 70, 67, 71,156, 72, 84, 81, 82, 83, 88, 85, 86, 87,
+140, 73,205,206,203,207,204,225,112,221,222,219,220,141,142,223
+ );
}
if ($needs_binmode) {
@@ -492,12 +518,16 @@ sub cgi_error {
# unescape URL-encoded data
sub unescape {
- shift() if ref($_[0]) || $_[0] eq $DefaultClass;
- my $todecode = shift;
- return undef unless defined($todecode);
- $todecode =~ tr/+/ /; # pluses become spaces
- $todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
- return $todecode;
+ shift() if ref($_[0]) || $_[0] eq $DefaultClass;
+ my $todecode = shift;
+ return undef unless defined($todecode);
+ $todecode =~ tr/+/ /; # pluses become spaces
+ if ($EBCDIC) {
+ $todecode =~ s/%([0-9a-fA-F]{2})/pack("c",$A2E[hex($1)])/ge;
+ } else {
+ $todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
+ }
+ return $todecode;
}
# URL-encode data
@@ -1060,6 +1090,7 @@ sub dump {
push(@result,"<UL>");
foreach $value ($self->param($param)) {
$value = $self->escapeHTML($value);
+ $value =~ s/\n/<BR>\n/g;
push(@result,"<LI>$value");
}
push(@result,"</UL>");
@@ -1756,9 +1787,7 @@ sub checkbox {
$the_label = $self->escapeHTML($the_label);
my($other) = @other ? " @other" : '';
$self->register_parameter($name);
- return <<END;
-<INPUT TYPE="checkbox" NAME="$name" VALUE="$value"$checked$other>$the_label
-END
+ return qq{<INPUT TYPE="checkbox" NAME="$name" VALUE="$value"$checked$other>$the_label};
}
END_OF_FUNC
@@ -3250,7 +3279,14 @@ unless ($TMPDIRECTORY) {
"${vol}${SL}Temporary Items",
"${SL}WWW_ROOT");
unshift(@TEMP,$ENV{'TMPDIR'}) if exists $ENV{'TMPDIR'};
- unshift(@TEMP,(getpwuid($<))[7].'/tmp') if $CGI::OS eq 'UNIX';
+
+ #
+ # unshift(@TEMP,(getpwuid($<))[7].'/tmp') if $CGI::OS eq 'UNIX';
+ # Rob: getpwuid() is unfortunately UNIX specific. On brain dead OS'es this
+ # : can generate a 'getpwuid() not implemented' exception, even though
+ # : it's never called. Found under DOS/Win with the DJGPP perl port.
+ # : Refer to getpwuid() only at run-time if we're fortunate and have UNIX.
+ unshift(@TEMP,(eval {(getpwuid($<))[7]}).'/tmp') if $CGI::OS eq 'UNIX';
foreach (@TEMP) {
do {$TMPDIRECTORY = $_; last} if -d $_ && -w _;
View
@@ -192,9 +192,16 @@ use Carp;
@EXPORT = qw(confess croak carp);
@EXPORT_OK = qw(carpout fatalsToBrowser wrap set_message cluck);
+BEGIN {
+ $] >= 5.005
+ ? eval q#sub ineval { $^S }#
+ : eval q#sub ineval { _longmess() =~ /eval [\{\']/m }#;
+ $@ and die;
+}
+
$main::SIG{__WARN__}=\&CGI::Carp::warn;
$main::SIG{__DIE__}=\&CGI::Carp::die;
-$CGI::Carp::VERSION = '1.13';
+$CGI::Carp::VERSION = '1.14';
$CGI::Carp::CUSTOM_MSG = undef;
# fancy import routine detects and handles 'errorWrap' specially.
@@ -251,14 +258,15 @@ sub _longmess {
}
sub die {
- my $message = shift;
- my $time = scalar(localtime);
- my($file,$line,$id) = id(1);
- $message .= " at $file line $line." unless $message=~/\n$/;
- &fatalsToBrowser($message) if $WRAP && _longmess() !~ /eval [{\']/m;
- my $stamp = stamp;
- $message=~s/^/$stamp/gm;
- realdie $message;
+ realdie @_ if ineval;
+ my $message = shift;
+ my $time = scalar(localtime);
+ my($file,$line,$id) = id(1);
+ $message .= " at $file line $line." unless $message=~/\n$/;
+ &fatalsToBrowser($message) if $WRAP;
+ my $stamp = stamp;
+ $message=~s/^/$stamp/gm;
+ realdie $message;
}
sub set_message {
View
@@ -13,7 +13,7 @@ package CGI::Cookie;
# wish, but if you redistribute a modified version, please attach a note
# listing the modifications you have made.
-$CGI::Cookie::VERSION='1.08';
+$CGI::Cookie::VERSION='1.10';
use CGI;
use overload '""' => \&as_string,
@@ -96,9 +96,9 @@ sub new {
'value'=>[@values],
},$class;
- # IE requires the path to be present for some reason.
- ($path = $ENV{'SCRIPT_NAME'})=~s![^/]+$!! unless $path;
- $domain ||= $ENV{'SERVER_NAME'};
+ # IE requires the path and domain to be present for some reason.
+ $path ||= CGI::url(-absolute=>1);
+ $domain ||= CGI::virtual_host();
$self->path($path) if defined $path;
$self->domain($domain) if defined $domain;
View
@@ -6,7 +6,7 @@
<BODY bgcolor="#FFFFFF">
<H1><IMG SRC="examples/dna.small.gif" ALT="[logo]">
CGI.pm - a Perl5 CGI Library</H1>
-Version 2.51, 5/3/1999, L. Stein
+Version 2.52, 6/8/1999, L. Stein
<p>
<H2>Abstract</H2> This perl 5 library uses objects to create Web
@@ -957,8 +957,7 @@
<blockquote><pre>
print $query-&gt;redirect(-location=&gt;'http://somewhere.else/',
- -nph=&gt;1,
- -method=&gt;GET);
+ -nph=&gt;1);
</pre></blockquote>
The <strong>-location</strong> parameter gives the destination URL.
@@ -2668,7 +2667,7 @@
long line without carriage returns or indentation. This is yuck, but
it does reduce the size of the documents by 10-20%. To get
pretty-printed output, please use <cite>CGI::Pretty</cite>, a subclass
-contributed by <a href="bpaulsen@lehman.com">Brian Paulsen</a>.
+contributed by <a href="mailto:bpaulsen@lehman.com">Brian Paulsen</a>.
<H3>Optional Utility Functions</H3>
@@ -4549,7 +4548,7 @@
reports, please provide the following information:
<ul>
- <li>the version of CGI.pm (<code>perl -MCGI 'print $CGI::VERSION'</code>)
+ <li>the version of CGI.pm (<code>perl -MCGI -e 'print '$CGI::VERSION'</code>)
<li>the version of Perl (<code>perl -v</code>)
<li>the name and version of your Web server
<li>the name and version of the operating system you are using
@@ -4567,6 +4566,16 @@
<HR>
<H2><A NAME="new">Revision History</A></H2>
+<h3>Version 2.52</h3>
+<ol>
+ <li>Spurious newline in checkbox() routine removed. (courtesy John Essen)
+ <li>TEXTAREA linebreaks now respected in dump() routine. (courtesy John Essen)
+ <li>Patches for DOS ports (courtesy Robert Davies)
+ <li>Patches for VMS
+ <li>More fixes for cookie problems
+ <li>Fix CGI::Carp so that it doesn't affect eval{} blocks (courtesy Byron Brummer)
+</ol>
+
<h3>Version 2.51</h3>
<ol>
<li>Fixed problems with cookies not being remembered when sent to IE 5.0 (and Netscape 5.0 too?)
@@ -5248,6 +5257,6 @@
<a href="http://www.cshl.org/">Cold Spring Harbor Laboratory</a></ADDRESS>
<P>
<!-- hhmts start -->
-Last modified: Mon May 3 14:06:21 EDT 1999
+Last modified: Tue Jun 8 11:06:02 EDT 1999
<!-- hhmts end -->
</BODY> </HTML>

0 comments on commit 9feab8d

Please sign in to comment.