summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Process/Utils.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-02-16 08:55:42 +0000
committerfukachan <fukachan>2003-02-16 08:55:42 +0000
commita1a9aacd374770ec0d804ee07fa101c737263d2e (patch)
tree7883c83f0ac1f5f3b93f28d4a30bfb577a03aa24 /fml/lib/FML/Process/Utils.pm
parent0d30ae4a5d49becff48985bff47c1c6f1f013d2d (diff)
downloadfml8-a1a9aacd374770ec0d804ee07fa101c737263d2e.tar.gz
fml8-a1a9aacd374770ec0d804ee07fa101c737263d2e.tar.bz2
fml8-a1a9aacd374770ec0d804ee07fa101c737263d2e.zip
implemente the following methods:
is_safe_syntax() language_default() language_of_cgi_message() language_of_reply_message() language_of_html_file()
Diffstat (limited to 'fml/lib/FML/Process/Utils.pm')
-rw-r--r--fml/lib/FML/Process/Utils.pm73
1 files changed, 69 insertions, 4 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm
index 482be2ee..e2f363c3 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.58 2003/02/09 12:31:45 fukachan Exp $
+# $FML: Utils.pm,v 1.59 2003/02/15 02:54:00 fukachan Exp $
#
package FML::Process::Utils;
@@ -532,14 +532,31 @@ sub safe_cgi_action_name
my ($curproc) = @_;
my $name = $curproc->myname();
+ if ($curproc->is_safe_syntax('action', $name)) {
+ return $name;
+ }
+ else {
+ return undef;
+ }
+}
+
+
+# Descriptions: check $str with $class regexp defined in FML::Restriction.
+# Arguments: OBJ($curproc) STR($class) STR($str)
+# Side Effects: none
+# Return Value: NUM(1 or 0)
+sub is_safe_syntax
+{
+ my ($curproc, $class, $str) = @_;
+
use FML::Restriction::Base;
my $safe = new FML::Restriction::Base;
- if ($safe->regexp_match('action', $name)) {
- return $name;
+ if ($safe->regexp_match($class, $str)) {
+ return 1;
}
else {
- return undef;
+ return 0;
}
}
@@ -1162,6 +1179,54 @@ sub set_print_style
}
+# Descriptions: inform default language
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: STR
+sub language_default
+{
+ my ($curproc) = @_;
+
+ return 'euc-jp'; # default
+}
+
+
+# Descriptions: inform language returned by cgi process
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: STR
+sub language_of_cgi_message
+{
+ my ($curproc) = @_;
+ my $config = $curproc->{ config };
+ my $charset = $config->{ cgi_charset };
+
+ return( $charset || $curproc->language_default() );
+}
+
+
+# Descriptions: language used in reply message
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: STR
+sub language_of_reply_message
+{
+ my ($curproc) = @_;
+ $curproc->language_default();
+}
+
+
+# Descriptions: language used in html files
+# Arguments: OBJ($curproc)
+# Side Effects: none
+# Return Value: STR
+sub language_of_html_file
+{
+ my ($curproc) = @_;
+ $curproc->language_default();
+}
+
+
=head2 hints()
return hints as HASH_REF.