php-proxy icon indicating copy to clipboard operation
php-proxy copied to clipboard

Improve parsing of href=

Open webaddicto opened this issue 7 years ago • 0 comments

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

webaddicto avatar Feb 17 '17 23:02 webaddicto