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

Improve parsing of href= #50

Open
webaddicto opened this issue Feb 17, 2017 · 0 comments
Open

Improve parsing of href= #50

webaddicto opened this issue Feb 17, 2017 · 0 comments

Comments

@webaddicto
Copy link
Contributor

webaddicto commented Feb 17, 2017

This malformed href= is not correctly parsed:

<a href=/1233fffdc0d1537bb0046c316ca0385c967a906f>

On Glype it is parsed correctly using this regex:

#(?><[A-Z0-9]{1,15})(?>\s+[^>\s]+)*?\s*(?>(href|src|background|poster)\s*=(?!\\\\)\s*)(?>([\\\'"])?)((?(2)(?(?<=")[^"]{1,2048}|[^\\\']{1,2048})|[^ >]{1,2048}))(?(2)\\2|)#i

Tested here: http://www.phpliveregex.com/p/j63

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

No branches or pull requests

1 participant