[prev in list] [next in list] [prev in thread] [next in thread]
List: interchange-users
Subject: Re: [ic] Stripping CR/LF from form input - Solved
From: Mike Heins <mike () perusion ! com>
Date: 2006-04-23 22:37:06
Message-ID: 20060423223706.GA8171 () bill ! heins ! net
[Download RAW message or body]
Quoting DB (DB@M-and-D.com):
> >> I did however get things working by adding this to my catalog.cg:
> >>
> >> ##########################
> >> CodeDef no_crlf Filter
> >> CodeDef no_crlf Routine <<EOR
> >> sub {
> >> my $val = shift;
> >> $val =~ s/[\r\n]+/ /g;
> >> return $val;
> >> }
> >> EOR
> >>
> >> Filter notes no_crlf
> >> ##########################
> >>
> >>
> >> I did not realize that the
> >>
> >> Filter notes no_crlf
> >>
> >> was required. Thanks for everyone's help, especially Mike!
> >
> > It isn't required -- in fact, it is invasive in that any variable
> > named "notes" will be filtered in that way. It is probably better
> > to use some method besides that, but it does work if nothing else
> > does.
> >
> > There still must be some reason that it is getting in the database
> > that way; if you put that filter in your input screen by any of the
> > normal methods it would be better.
> >
> > --
> > Mike Heins
> > Perusion -- Expert Interchange Consulting http://www.perusion.com/
> > phone +1.765.647.1295 tollfree 800-949-1889 <mike at perusion.com>
>
> You're right of course, something is odd. If I remove the
>
> Filter notes no_crlf
>
> line from catalog.cfg, the filtering does not happen, even with
>
> <TEXTAREA NAME="notes" ROWS=10 COLS=85>
> [filter no_crlf][data table=transactions col=notes key=[loop-code]][/filter]
> </TEXTAREA>
>
> explicitly in the form. (my email program is wrapping this)
That will do zero for you unless the user is guaranteed to not hit
RETURN.
>
> Things are working as required with that catalog.cfg lin in place, but
> I'm wondering why the filter does not work in the form. Not knowing the
> "why" for stuff like that bothers me.
The filter has to happen after submission, not before.
--
Mike Heins
Perusion -- Expert Interchange Consulting http://www.perusion.com/
phone +1.765.647.1295 tollfree 800-949-1889 <mike@perusion.com>
Software axiom: Lack of speed kills.
_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic