From 0b747cb424c2f783761201ad9f46ccffcb94c750 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 18 Sep 2011 13:11:20 +0100 Subject: [PATCH] string validator now attempts to fix windows smart-quotes --- Block.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Block.pm b/Block.pm index 78ad147..3ac4071 100644 --- a/Block.pm +++ b/Block.pm @@ -147,6 +147,11 @@ sub validate_string { # Convert all characters in the string to safe versions $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 $text =~ s/^\s+//; $text =~ s/\s+$//;