string validator now attempts to fix windows smart-quotes
This commit is contained in:
parent
a87608a88e
commit
0b747cb424
5
Block.pm
5
Block.pm
@ -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+$//;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user