Permalink
Browse files

validate_format_of 関数を追加

  • Loading branch information...
milk1000cc committed Jul 15, 2010
1 parent cdf17f5 commit 367caa1cd488bc77260e9cd9fbd4519518d41234
Showing with 7 additions and 0 deletions.
  1. +7 −0 awesome-form.php
View
@@ -116,6 +116,13 @@ function validate_inclusion_of($name, $options = array()) {
}
}
+function validate_format_of($name, $options = array()) {
+ global $_ERROR;
+ if (!preg_match($options['with'], $_REQUEST[$name])) {
+ $_ERROR[] = i18n($name).'は不正な値です。';
+ }
+}
+
function nice_file_put_contents($filename, $data, $mode = 'w') {
$fp = fopen($filename, $mode);
fwrite($fp, $data);

0 comments on commit 367caa1

Please sign in to comment.