Permalink
Browse files

trial balloon

  • Loading branch information...
1 parent 79f1600 commit 671c9b95bccdc85e6255ffdbf349fd0e5f3320ec lstein committed Sep 12, 2002
Showing with 29 additions and 16 deletions.
  1. +6 −6 CGI.pm
  2. +13 −7 CGI/Cookie.pm
  3. +9 −2 cgi_docs.html
  4. +1 −1 t/html.t
View
@@ -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.69 2002-09-12 03:45:05 lstein Exp $';
-$CGI::VERSION='2.85';
+$CGI::revision = '$Id: CGI.pm,v 1.70 2002-09-12 03:53:38 lstein Exp $';
+$CGI::VERSION='2.86';
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
@@ -1959,8 +1959,8 @@ sub escapeHTML {
uc $self->{'.charset'} eq 'WINDOWS-1252';
if ($latin) { # bug in some browsers
$toencode =~ s{'}{'}gso;
- $toencode =~ s{\x8b}{‹}gso;
- $toencode =~ s{\x9b}{›}gso;
+ $toencode =~ s{\x8b}{‹}gso;
+ $toencode =~ s{\x9b}{›}gso;
if (defined $newlinestoo && $newlinestoo) {
$toencode =~ s{\012}{
}gso;
$toencode =~ s{\015}{
}gso;
@@ -4971,9 +4971,9 @@ Provided that you have specified a character set of ISO-8859-1 (the
default), the standard HTML escaping rules will be used. The "<"
character becomes "&lt;", ">" becomes "&gt;", "&" becomes "&amp;", and
the quote character becomes "&quot;". In addition, the hexadecimal
-0x8b and 0x9b characters, which many windows-based browsers interpret
+0x8b and 0x9b characters, which some browsers incorrectly interpret
as the left and right angle-bracket characters, are replaced by their
-numeric HTML entities ("&#139" and "&#155;"). If you manually change
+numeric character entities ("&#8249" and "&#8250;"). If you manually change
the charset, either by calling the charset() method explicitly or by
passing a -charset argument to header(), then B<all> characters will
be replaced by their numeric entities, since CGI.pm has no lookup
View
@@ -117,21 +117,20 @@ sub new {
$self->domain($domain) if defined $domain;
$self->secure($secure) if defined $secure;
$self->expires($expires) if defined $expires;
+# $self->max_age($expires) if defined $expires;
return $self;
}
sub as_string {
my $self = shift;
return "" unless $self->name;
- my(@constant_values,$domain,$path,$expires,$secure);
+ my(@constant_values,$domain,$path,$expires,$max_age,$secure);
- push(@constant_values,"domain=$domain") if $domain = $self->domain;
- push(@constant_values,"path=$path") if $path = $self->path;
- if ($expires = $self->expires) {
- push(@constant_values,"expires=$expires");
- push(@constant_values,"max-age=$expires");
- }
+ push(@constant_values,"domain=$domain") if $domain = $self->domain;
+ push(@constant_values,"path=$path") if $path = $self->path;
+ push(@constant_values,"expires=$expires") if $expires = $self->expires;
+ push(@constant_values,"max-age=$max_age") if $max_age = $self->max_age;
push(@constant_values,"secure") if $secure = $self->secure;
my($key) = escape($self->name);
@@ -193,6 +192,13 @@ sub expires {
return $self->{'expires'};
}
+sub max_age {
+ my $self = shift;
+ my $expires = shift;
+ $self->{'max-age'} = CGI::Util::expire_calc($expires)-time if defined $expires;
+ return $self->{'max-age'};
+}
+
sub path {
my $self = shift;
my $path = shift;
View
@@ -7,7 +7,7 @@
<BODY bgcolor="#FFFFFF">
<H1><IMG SRC="examples/dna.small.gif" ALT="[logo]">
CGI.pm - a Perl5 CGI Library</H1>
-Version 2.85, 9/11/2002, L. Stein
+Version 2.86, 9/11/2002, L. Stein
<p>
<H2>Abstract</H2> This perl 5 library uses objects to create Web
@@ -4696,13 +4696,20 @@
<HR>
<H2><A NAME="new">Revision History</A></H2>
+<h3>Version 2.86</h3>
+<ol>
+ <li>Fixes for broken CGI::Cookie expiration dates introduced in
+ 2.84.
+</ol>
<h3>Version 2.85</h3>
<ol>
<li>Fix for broken autoEscape function introduced in 2.84.
</ol>
<h3>Version 2.84</h3>
<ol>
<li>Fix for failed file uploads on Cygwin platforms.
+ <li>HTML escaping code now replaced 0x8b and 0x9b with unicode
+ references &#8249; and *#8250;
</ol>
<h3>Version 2.83</h3>
@@ -5675,6 +5682,6 @@
<a href="http://www.cshl.org/">Cold Spring Harbor Laboratory</a></ADDRESS>
<P>
<!-- hhmts start -->
-Last modified: Wed Sep 11 09:13:47 EDT 2002
+Last modified: Wed Sep 11 23:53:30 EDT 2002
<!-- hhmts end -->
</BODY> </HTML>
View
@@ -85,7 +85,7 @@ test(17,$h =~ m!^Set-Cookie: fred=chocolate&chip\; path=/${CRLF}Date:.*${CRLF}Co
test(18,start_h3 eq '<h3>');
test(19,end_h3 eq '</h3>');
test(20,start_table({-border=>undef}) eq '<table border>');
-test(21,h1(escapeHTML("this is <not> \x8bright\x9b")) eq '<h1>this is &lt;not&gt; &#139;right&#155;</h1>');
+test(21,h1(escapeHTML("this is <not> \x8bright\x9b")) eq '<h1>this is &lt;not&gt; &#8249;right&#8250;</h1>');
charset('utf-8');
if (ord("\t") == 9) {
test(22,h1(escapeHTML("this is <not> \x8bright\x9b")) eq '<h1>this is &lt;not&gt; ‹right›</h1>');

0 comments on commit 671c9b9

Please sign in to comment.