thinkphp 5.1 field不支持汉字别名解决办法/报错 throw new Exception(‘not support data:’ . $key);
搜索到 http://taotaoit.com/article/details/884.html
这位朋友找到原因,感谢,
把thinkphp/library/think/db/builder/Mysql.php中大约148行的正则表达式增加 \x7f-\xff
但我觉得这样不是很好,不知道会不会出现安全问题,我觉得改成 x{4e00}-\x{9fa5} //只增加匹配汉字好点.**ps,我对正则不太懂,***
我改成下面这样:
1 |
if ($strict && !preg_match(\'/^[\w\.\*\x{4e00}-\x{9fa5}] $/u\', $key)) { |