* Check the key of user when setting.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user