Athlon1600 / php-proxy

A web proxy script written in PHP and built as an alternative to Glype.
https://www.php-proxy.com
MIT License
298 stars 158 forks source link

Improve parsing of href= #50

Open webaddicto opened 7 years ago

webaddicto commented 7 years ago

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