- invalid_float 메시지 추가

- 파일 용량 설정의 룰셋 추가 수정
- XML Filter에서 float를 처리할 수 있도록 룰세 추가
This commit is contained in:
bnu 2016-07-26 17:26:37 +09:00 committed by Kijin Sung
parent 46278a886b
commit 61c54504ef
9 changed files with 14 additions and 5 deletions

View file

@ -92,7 +92,7 @@ class Validator
'alpha' => '/^[a-z]*$/i',
'alpha_number' => '/^[a-z][a-z0-9_]*$/i',
'number' => '/^(?:[1-9]\\d*|0)$/',
'float' => '/^\d*(\.?\d*)$/'
'float' => '/^\d+(\.\d+)?$/'
));
$this->_has_mb_func = is_callable('mb_strlen');

View file

@ -51,6 +51,10 @@
// number
var regNum = /^[0-9]*$/;
this.cast('ADD_RULE', ['number', regNum]);
// float
var regFloat = /^\d+(\.\d+)?$/;
this.cast('ADD_RULE', ['float', regFloat]);
// }}} add filters
},
// run validator

View file

@ -310,6 +310,7 @@ $lang->filter['invalid_alpha'] = 'The format of %s is invalid. Please enter Engl
$lang->filter['invalid_alpha_number'] = 'The format of %s is invalid. Please enter English alphabets and numbers only.';
$lang->filter['invalid_mid'] = 'The format of %s is invalid. Module ID should be begun with a letter. Subsequent characters may be letters, digits or underscore characters.';
$lang->filter['invalid_number'] = 'The format of %s is invalid. Please enter numbers only.';
$lang->filter['invalid_float'] = 'The format of %s is invalid. Please enter numbers only.';
$lang->filter['invalid_extension'] = 'The format of %s is invalid. e.g.) *.* or *.jpg;*.gif;.';
$lang->security_warning_embed = 'Due to security concern, administrators are not allowed to view embedded items.<BR /> To view them, please use another non-administrator ID.';
$lang->msg_pc_to_mobile = 'View mobile optimized version of this page';

View file

@ -293,6 +293,7 @@ $lang->filter['invalid_alpha'] = '%sの形式が正しくありません。半
$lang->filter['invalid_alpha_number'] = '%sの形式が正しくありません。半角英数字で入力してください。';
$lang->filter['invalid_mid'] = '%sの形式が正しくありません。 最初の文字は英文から始め、「英文数字_」組合せで入力が必要です。';
$lang->filter['invalid_number'] = '%sの形式が正しくありません。半角数字で入力してください。';
$lang->filter['invalid_float'] = '%sの形式が正しくありません。半角数字で入力してください。';
$lang->security_warning_embed = 'セキュリティ問題のため、管理者IDではembedを見ることができません。<br />他のIDでログインしてください。';
$lang->msg_pc_to_mobile = 'このページは、モバイル表示が可能です。モバイル表示へ移動しますか?';
$lang->cmd_yes = 'はい';

View file

@ -310,6 +310,7 @@ $lang->filter['invalid_alpha'] = '%s의 형식이 잘못되었습니다. 영문
$lang->filter['invalid_alpha_number'] = '%s의 형식이 잘못되었습니다. 영문과 숫자로만 입력해야 합니다.';
$lang->filter['invalid_mid'] = '%s의 형식이 잘못되었습니다. 첫 글자는 영문으로 시작해야 하며 \'영문+숫자+_\'로만 입력해야 합니다.';
$lang->filter['invalid_number'] = '%s의 형식이 잘못되었습니다. 숫자로만 입력해야 합니다.';
$lang->filter['invalid_float'] = '%s의 형식이 잘못되었습니다. 숫자로만 입력해야 합니다.';
$lang->filter['invalid_extension'] = '%s의 형식이 잘못되었습니다. *.* 나 *.jpg;*.gif; 처럼 입력해야 합니다.';
$lang->security_invalid_session = '바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.';
$lang->security_warning_embed = '보안 문제로 관리자 아이디로는 embed를 볼 수 없습니다. 확인하려면 다른 아이디로 접속하세요';

View file

@ -277,6 +277,7 @@ $lang->filter['invalid_alpha'] = '%s只能输入英文字母';
$lang->filter['invalid_alpha_number'] = '%s只能输入英文或数字';
$lang->filter['invalid_mid'] = '%s 格式错误。 模块名称只能用英文、数字及下划线,开头必须是英文。';
$lang->filter['invalid_number'] = '%s只能输入数字';
$lang->filter['invalid_float'] = '%s只能输入数字';
$lang->security_warning_embed = '由于安全问题不允许用系统管理员ID操作embed对象请使用其他拥有管理权限的ID操作。';
$lang->cmd_yes = '是';
$lang->cmd_no = '否';

View file

@ -276,6 +276,7 @@ $lang->filter['invalid_alpha'] = '%s只能輸入英文字母';
$lang->filter['invalid_alpha_number'] = '%s只能輸入英文或數字';
$lang->filter['invalid_mid'] = '%s 格式錯誤。 模組名稱只能使用英文、數字及底線,開頭必須是英文。';
$lang->filter['invalid_number'] = '%s只能輸入數字';
$lang->filter['invalid_float'] = '%s只能輸入數字';
$lang->security_warning_embed = '基於安全因素,管理員無法檢視嵌入的物件。<BR /> 請使用其他非管理員帳號檢視。';
$lang->msg_pc_to_mobile = '此頁面有手機頁面,要移至手機頁面嗎?';
$lang->cmd_yes = '是';

View file

@ -4,8 +4,8 @@
<rule name="extension" type="regex" test="/^(?:\*\.\*|(\*\.\w+;\s*)*\*\.\w+;?)$/i" />
</customrules>
<fields>
<field name="allowed_filesize" required="true" rule="number" default="2" />
<field name="allowed_attach_size" required="true" rule="number" default="2" />
<field name="allowed_filesize" required="true" rule="float" default="2" />
<field name="allowed_attach_size" required="true" rule="float" default="2" />
<field name="allowed_filetypes" required="true" rule="extension" />
</fields>
</ruleset>

View file

@ -34,13 +34,13 @@
<div class="x_control-group">
<label for="filesize" class="x_control-label">{$lang->allowed_filesize} <a class="x_icon-question-sign" href="./common/manual/admin/index.html#UMAN_config_file_size" target="_blank">{$lang->help}</a></label>
<div class="x_controls">
<input type="number" id="filesize" name="allowed_filesize" value="{$config->allowed_filesize}" /> MB/{$upload_max_filesize}
<input type="number" step="any" id="filesize" name="allowed_filesize" value="{$config->allowed_filesize}" /> MB / {$upload_max_filesize}
</div>
</div>
<div class="x_control-group">
<label for="attachSize" class="x_control-label">{$lang->allowed_attach_size} <a class="x_icon-question-sign" href="./common/manual/admin/index.html#UMAN_config_file_document_attach_limit" target="_blank">{$lang->help}</a></label>
<div class="x_controls">
<input type="number" id="attachSize" name="allowed_attach_size" value="{$config->allowed_attach_size}" /> MB
<input type="number" step="any" id="attachSize" name="allowed_attach_size" value="{$config->allowed_attach_size}" /> MB
</div>
</div>
<div class="x_control-group">