Skip to content

Commit

Permalink
validate_format_of 関数を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
milk1000cc committed Jul 15, 2010
1 parent cdf17f5 commit 367caa1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions awesome-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 367caa1

Please sign in to comment.