Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

springjk
Copy link
Contributor

@@ -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));
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以去这里查看:https://regex101.com/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #515

Copy link
Collaborator

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 😢

Copy link
Contributor Author

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。

@springjk
Copy link
Contributor Author

重新提交至 #519

@springjk springjk closed this Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants