修复 BUG

This commit is contained in:
Comsenz 2017-08-07 12:34:38 +08:00
parent c81b5c99fd
commit 932a515563
1 changed files with 11 additions and 3 deletions

View File

@ -357,9 +357,17 @@ class base {
}
function input($k) {
if($k == 'uid' && !preg_match("/^[0-9]+$/", $this->input[$k])){
if($k == 'uid') {
if(is_array($this->input[$k])) {
foreach ($this->input[$k] as $value) {
if(!preg_match("/^[0-9]+$/", $value)) {
return NULL;
}
}
} elseif(!preg_match("/^[0-9]+$/", $this->input[$k])) {
return NULL;
}
}
return isset($this->input[$k]) ? (is_array($this->input[$k]) ? $this->input[$k] : trim($this->input[$k])) : NULL;
}