我遇到了CI禁止关键字符的问题。当我更改核心文件input.php
exit('Disallowed Key Characters!! Clear Your Cookies.'.$str);
我得到这个字符串
Disallowed Key Characters!!.qqfilechunk|attraction-Pulaki-temple-not-far-from-Jimbaran-seminyak-kuta-leagian-nusa-dua-and-sanur-close-to-cheap-hotels-cheap-flight-with-air-asia-4-can-be-great-experience-to-come-to-bali-and-enj-_jpg|101077|2000000
我已将pregmatch
更改为
preg_match("/^[#a-z0-9:_\/-|{}()%!=]+$/i", $str)
但我仍然收到Disallowed Key Character
消息。
答案 0 :(得分:1)
你的正则表达式存在一些问题:
-
必须转到字符块的末尾,因为这通常表示一系列字符.
句号。将正则表达式更改为:
/^[#a-z0-9:_\/|{}()%!=.-]+$/i
答案 1 :(得分:0)
将其更改为:
preg_match("/^[a-z0-9:_\/-]+$/i", $str)
它将避免错误。
检查您的输入标签是否还有任何缺失的引号或其他内容:
在这种情况下会发生错误:
<input type="text" name="nam value=" " />
因为我错过了名称标签的收尾报价!
检查这些类型的错误....