Subject: | HTML Escaping incomplete |
xml_escape() does not currently escape characters for option labels such
as "m²".
The following changes to Util.pm will escape all special characters
using HTML::Entities rather than the home-brew escaping that existed
prior to this.
*** Util.pm.orig Wed Oct 8 12:48:59 2008
--- Util.pm Wed Oct 8 12:52:10 2008
***************
*** 8,13 ****
--- 8,14 ----
use Readonly;
use Exporter qw/ import /;
use Carp qw/ croak /;
+ use HTML::Entities;
Readonly my $EMPTY_STR => q{};
Readonly my $SPACE => q{ };
***************
*** 332,343 ****
return $val if !length $val;
! $val =~ s/&/&/g;
! $val =~ s/"/"/g;
! $val =~ s/'/'/g;
! $val =~ s/</</g;
! $val =~ s/>/>/g;
! $val =~ s/²/²/g;
return $val;
}
--- 333,339 ----
return $val if !length $val;
! $val = encode_entities($val);
return $val;
}