I am missing this not. Realy bad things I block with mod_security.
Things needed for the "controll" of my webapplication I put in the session information. ( If not: I would use a handler to filter them out. )
Or in other words: I don't "die" in my mason pages. If I have bad parameters within my mason pages I need always a good user feedback.
I do test like:
if ( $pass =~ /\p{IsC}/ ) { $m->abort(404); }
if ( length($pass) < 8 ) { $err .= "Sorry humble master, but your password is too short,"; }
...
If I have args I always do _many_ tests on them or they are handled inside a module(e.g. topic IDs for DB interactions) - since I try to keep my perl code outside of the mason templates. I use mason as a templating tool (or try to :).
When your suggestion is implemented I would need a way to "handle" raised errors: <%OnError> </%OnError> <%NoError> </%NoError>
... hm mason template tags for exception handling ... hm THAT would be cool ^^
Timo
| Mark Hedges <[EMAIL PROTECTED]>
Gesendet von: [EMAIL PROTECTED] 27.06.2006 22:24 |
|
Is there any current or planned way to declare parameter
validation in an <%args> block? Or in some other block?
Maybe I missed this in the book.
That is, I want to do stuff like this:
<%args>
$foo => 1 , qr/^\d$/
$bar => , sub { shift->isa('Bar') } # req'd, no default?
@biz => , !grep $_ eq 'baz', @_
</%args>
Right now I do something akin to this:
<%args>
$foo => 1
$bar
@biz
</%args>
<%perl>
die('bad params')
if $foo !~ m{ \A \d \z }xms
|| !$bar->isa('Bar')
|| grep $_ eq 'baz', @biz;
</%perl>
Mark
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Mason-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mason-users

