Change 33094 by [EMAIL PROTECTED] on 2008/01/28 15:31:07
Subject: [PATCH] Fix uc/lc warnings in CGI.pm
From: "Jerry D. Hedden" <[EMAIL PROTECTED]>
Date: Mon, 28 Jan 2008 10:19:26 -0500
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/lib/CGI.pm#73 edit
Differences ...
==== //depot/perl/lib/CGI.pm#73 (text) ====
Index: perl/lib/CGI.pm
--- perl/lib/CGI.pm#72~32883~ 2008-01-06 13:43:24.000000000 -0800
+++ perl/lib/CGI.pm 2008-01-28 07:31:07.000000000 -0800
@@ -1837,7 +1837,7 @@
my($method,$action,$enctype,@other) =
rearrange([METHOD,ACTION,ENCTYPE],@p);
- $method = $self->escapeHTML(lc($method) || 'post');
+ $method = $self->escapeHTML(($method) ? lc($method) : 'post');
$enctype = $self->escapeHTML($enctype || &URL_ENCODED);
if (defined $action) {
$action = $self->escapeHTML($action);
@@ -2200,9 +2200,11 @@
else {
$toencode =~ s{"}{"}gso;
}
- my $latin = uc $self->{'.charset'} eq 'ISO-8859-1' ||
- uc $self->{'.charset'} eq 'WINDOWS-1252';
- if ($latin) { # bug in some browsers
+ # Handle bug in some browsers with Latin charsets
+ if ($self->{'.charset'} &&
+ (uc($self->{'.charset'}) eq 'ISO-8859-1' ||
+ uc($self->{'.charset'}) eq 'WINDOWS-1252'))
+ {
$toencode =~ s{'}{'}gso;
$toencode =~ s{\x8b}{‹}gso;
$toencode =~ s{\x9b}{›}gso;
End of Patch.