Browse Source

允许纯英文评论和留言

magicblack 3 years ago
parent
commit
8b8a1068f3

+ 3 - 4
application/index/controller/Comment.php

@@ -63,10 +63,9 @@ class Comment extends Base
         }
 
         $param['comment_content']= htmlentities(mac_filter_words($param['comment_content']));
-        $pattern = '/[^\x00-\x80]/';
-        if(!preg_match($pattern,$param['comment_content'])){
-            return ['code'=>1005,'msg'=>lang('index/require_cn')];
-        }
+        // if(!preg_match('/[^\x00-\x80]/',$param['comment_content'])){
+        //     return ['code'=>1005,'msg'=>lang('index/require_cn')];
+        // }
 
         if(!in_array($param['comment_mid'],['1','2','3','8','9','11'])){
             return ['code'=>1006,'msg'=>lang('index/mid_err')];

+ 3 - 4
application/index/controller/Gbook.php

@@ -70,10 +70,9 @@ class Gbook extends Base
         }
 
         $param['gbook_content']= htmlentities(mac_filter_words($param['gbook_content']));
-        $pattern = '/[^\x00-\x80]/';
-        if(!preg_match($pattern,$param['gbook_content'])){
-            return ['code'=>1005,'msg'=>lang('index/require_cn')];
-        }
+        // if(!preg_match('/[^\x00-\x80]/',$param['gbook_content'])){
+        //     return ['code'=>1005,'msg'=>lang('index/require_cn')];
+        // }
 
         $param['gbook_reply'] = '';