From 2d820491e677cd11483a4e57822e21e3c46909b8 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 1 Aug 2012 13:40:16 +0100 Subject: [PATCH] Whitespaces break length ghecks, damnit. --- Block.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Block.pm b/Block.pm index c64067d..9e1a05a 100644 --- a/Block.pm +++ b/Block.pm @@ -291,6 +291,8 @@ sub validate_htmlarea { my $scrubber = HTML::Scrubber -> new(); my $nohtml = $scrubber -> scrub($text); + $nohtml =~ s/[\t\r\n]//g; # Kill some kinds of whitespace that may be left by scrubber that will confuse length checks. + # If the text area is empty, deal with the whole default/required malarky if(!defined($nohtml) || !$nohtml) { # If the parameter is required, return empty and an error