diff options
| author | fukachan <fukachan> | 2003-02-15 02:54:00 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-02-15 02:54:00 +0000 |
| commit | 360a7ef8449e14883880bd51450cf50e0951e3b5 (patch) | |
| tree | 5fe213b38730ee26925f3a51859dd18226fafa79 /fml/lib/FML/Process | |
| parent | 348560cf5731058e6ed17fc3f8f767e3ccb943cf (diff) | |
| download | fml8-360a7ef8449e14883880bd51450cf50e0951e3b5.tar.gz fml8-360a7ef8449e14883880bd51450cf50e0951e3b5.tar.bz2 fml8-360a7ef8449e14883880bd51450cf50e0951e3b5.zip | |
implement safe_cgi_action_name()
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Utils.pm | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm index 3913f660..482be2ee 100644 --- a/fml/lib/FML/Process/Utils.pm +++ b/fml/lib/FML/Process/Utils.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Utils.pm,v 1.57 2003/02/01 04:34:33 fukachan Exp $ +# $FML: Utils.pm,v 1.58 2003/02/09 12:31:45 fukachan Exp $ # package FML::Process::Utils; @@ -522,6 +522,28 @@ sub myname } +# Descriptions: return the current action name, +# which syntax is checked by regexp. +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: STR +sub safe_cgi_action_name +{ + my ($curproc) = @_; + my $name = $curproc->myname(); + + use FML::Restriction::Base; + my $safe = new FML::Restriction::Base; + + if ($safe->regexp_match('action', $name)) { + return $name; + } + else { + return undef; + } +} + + # Descriptions: return raw @ARGV of the current process, # where @ARGV is before getopts() applied # Arguments: OBJ($curproc) |
