Exemplo n.º 1
0
         exit("result=1&msg=" . $strTenYearUrl . "?error=-1");
     } else {
         Com_System::url_redirect($strTenYearUrl . "?error=-1");
     }
 }
 $nknamePattern = "/[^\\x{4e00}-\\x{9fa5}A-Za-z0-9]+/u";
 $nkCharset = mb_detect_encoding($name, array('UTF-8', 'GB2312'));
 if ($nkCharset != "UTF-8") {
     //	url_msg_redirect("您填写的昵称不合法!!","/active.php");
     if ($bAjax) {
         exit("result=0&msg=");
     } else {
         Com_System::url_redirect($webUrl . "/active.php?e_code=-16");
     }
 }
 $iNameLen = Com_Filter::get_length($name);
 if ($iNameLen < 3 || $iNameLen > 12) {
     //	url_msg_redirect("您填写的昵称长度不合法!!","/active.php");
     if ($bAjax) {
         exit("result=0&msg=" . $arrLanguage["10215"]['content']);
     } else {
         Com_System::url_redirect($webUrl . "/active.php?e_code=-17");
     }
 }
 if (preg_match($nknamePattern, $name)) {
     //	url_msg_redirect("您填写的昵称不合法!!","/active.php");
     if ($bAjax) {
         exit("result=0&msg=" . $arrLanguage["10214"]['content']);
     } else {
         Com_System::url_redirect($webUrl . "/active.php?e_code=-16");
     }
Exemplo n.º 2
0
 /**
  * 检测宣言内容是否合法
  * @param unknown $introduce
  */
 protected function check_introduce($introduce)
 {
     if ($introduce) {
         $introduceLen = Com_Filter::get_length($introduce);
         if ($introduceLen > 280) {
             //长度不符
             $this->throw_error('170108');
         } else {
             if (is_numeric($introduce)) {
                 //不为纯数字){
                 $this->throw_error('10238');
             } else {
                 if (!Com_Filter::check_badWord($introduce)) {
                     //内容不合法
                     $this->throw_error('170109');
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 public function check_exact_param($cost_gold, $red_num, $message)
 {
     if ($cost_gold > 9999) {
         $this->throw_error('1744001');
     }
     if ($cost_gold <= 0) {
         $this->throw_error('20004');
     }
     if ($red_num <= 0) {
         $this->throw_error('1744003');
     }
     if ($red_num > 15) {
         $this->throw_error('1744002');
     }
     if ($red_num > $cost_gold) {
         $this->throw_error('1744005');
     }
     $message = trim($message);
     $len = Com_Filter::get_length($message);
     if ($len > 50) {
         $this->throw_error('10219');
     } else {
         if (is_numeric($message)) {
             //不为纯数字){
             $this->throw_error('10238');
         } else {
             if (!Com_Filter::check_badWord($message)) {
                 //内容不合法
                 $this->throw_error('10220');
             }
         }
     }
 }