string validator now attempts to fix windows smart-quotes

This commit is contained in:
Chris 2011-09-18 13:11:20 +01:00
parent a87608a88e
commit 0b747cb424

View File

@ -147,6 +147,11 @@ sub validate_string {
# Convert all characters in the string to safe versions # Convert all characters in the string to safe versions
$text = encode_entities($text); $text = encode_entities($text);
# Convert horrible smart quote crap from windows
foreach my $char (keys(%$self -> {"template"} ->{"entities")) {
$text =~ s/$char/$self->{template}->{entities}->{$char}/g;
}
# Now trim spaces # Now trim spaces
$text =~ s/^\s+//; $text =~ s/^\s+//;
$text =~ s/\s+$//; $text =~ s/\s+$//;