* Check the key of user when setting.

This commit is contained in:
wumo
2018-03-20 10:00:30 +08:00
parent a87465f453
commit cd918d09fd
4 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -116,9 +116,10 @@ class custom extends control
foreach($_POST['keys'] as $index => $key)
{
/* Fix bug #942. */
if(!empty($key)) $key = trim($key);
if($field == 'priList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->priListKey));
if($module == 'bug' and $field == 'severityList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->severityListKey));
if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-zA-Z_0-9]+$/')) die(js::alert($this->lang->custom->notice->keyList));
if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_0-9]+$/')) die(js::alert($this->lang->custom->notice->keyList));
/* the length of role is 20, check it when save. */
if($module == 'user' and $field == 'roleList' and strlen($key) > 10) die(js::alert($this->lang->custom->notice->userRole));