-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
兼容虚拟主机上的正则表达式#515 #516
兼容虚拟主机上的正则表达式#515 #516
Conversation
fix bug for xml preg_replace
@@ -277,7 +277,7 @@ public function parseJSON($body) | |||
*/ | |||
protected function fuckTheWeChatInvalidJSON($invalidJSON) | |||
{ | |||
return preg_replace("/\p{Cc}/u", '', trim($invalidJSON)); | |||
return preg_replace('/[\x00-\x1F\x7F-\x9F]/u', '', trim($invalidJSON)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\p{Cc}
matches an ASCII [\x00-\x1F]
or Latin-1 [\x80-\x9F]
control character
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以去这里查看:https://regex101.com/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #515
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我说的问题合计你没看?\p{Cc}
等于 /[\x00-\x1F\x80-\x9F]/u
不等于你的: /[\x00-\x1F\x7F-\x9F]/u
😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看的文档是 http://www.regular-expressions.info/unicode.html,上面写的是 7f ,我一开始打开你的这个看到是个正则验证就没仔细看了,也没看清你写的是 80,非常抱歉,查看了你提供的验证和 Latin1 的定义,这个文档让我入坑了,已经按照你的说明重新提交,这个可以关了,Sorry。
重新提交至 #519 |
#515