Sat Dec 6 10:20:34 EST 2008 Mark Stosberg <mark@summersault.com>
* Fixed bug when calling unescapeHTML on HTML that wasn't properly escaped in the first place.
diff -rN -u old-CGI-Simple-1.106/Changes new-CGI-Simple-1.106/Changes
--- old-CGI-Simple-1.106/Changes 2008-12-06 10:21:52.000000000 -0500
+++ new-CGI-Simple-1.106/Changes 2008-12-06 10:21:52.000000000 -0500
@@ -136,4 +136,7 @@
to RSAVAGE.
- Applied BEROV's patch for UTF-8 form data handling. Refs #12481.
Thanks to BEROV.
+1.107 2008-12-06
+ - Fixed bug when calling unescapeHTML on HTML that wasn't properly escaped in the first place.
+ Thanks to M-Uchino and Mark Stosberg.
diff -rN -u old-CGI-Simple-1.106/lib/CGI/Simple/Util.pm new-CGI-Simple-1.106/lib/CGI/Simple/Util.pm
--- old-CGI-Simple-1.106/lib/CGI/Simple/Util.pm 2008-12-06 10:21:52.000000000 -0500
+++ new-CGI-Simple-1.106/lib/CGI/Simple/Util.pm 2008-12-06 10:21:52.000000000 -0500
@@ -152,7 +152,7 @@
/^#(\d+)$/ && $ebcdic ? chr($UTIL->{'a2e'}->[$1]) :
/^#x([0-9a-f]+)$/i && $latin ? chr(hex($1)) :
/^#x([0-9a-f]+)$/i && $ebcdic ? chr($UTIL->{'a2e'}->[hex $1]) :
- $_
+ "\&$_;"
}gex;
return $unescape;
}
diff -rN -u old-CGI-Simple-1.106/t/050.simple.t new-CGI-Simple-1.106/t/050.simple.t
--- old-CGI-Simple-1.106/t/050.simple.t 2008-12-06 10:21:52.000000000 -0500
+++ new-CGI-Simple-1.106/t/050.simple.t 2008-12-06 10:21:52.000000000 -0500
@@ -1,4 +1,4 @@
-use Test::More tests => 331;
+use Test::More tests => 332;
use Carp;
use strict;
use warnings;
@@ -756,6 +756,8 @@
$sv = $q->unescapeHTML(
"<>&" <>&" " );
is( $sv, "<>&\"\012\015<>&\"\012\015", 'unescapeHTML(), 2' );
+$sv = $q->unescapeHTML('Jack & Jill went up the hill; to get a pail of water');
+is( $sv, 'Jack & Jill went up the hill; to get a pail of water', 'unescapeHTML(), 3 ' );
# put()
is( $q->put( '' ), 1, 'put(), 1' );