[ic] Stripping CR/LF from form input

Peter peter at pajamian.dhs.org
Sun Apr 23 00:34:02 EDT 2006


On 04/22/2006 08:12 PM, DB wrote:
> # filter to strip "returns" from coments
> CodeDef no_crlf Filter
> CodeDef titlecase Routine <<EOR
>  sub {
>  my $val = shift;
>  $val =~ s/[\x00-\x1F]+/ /g;

$val =~ s/[\r\n]+/ /g;

>  return $val;
>  }
> EOR

You realise that you're adding in linefeeds here (one above the data and 
one below)?  Try it as one line instead.

> <TEXTAREA NAME="notes">
> [filter no_crlf]
> [data table=transactions col=notes key=[loop-code]]
> [/filter]
> </TEXTAREA>

Peter


More information about the interchange-users mailing list