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

Support proxify URL on meta http-equiv="refresh" #47

Closed webaddicto closed 7 years ago

webaddicto commented 7 years ago

Make sure to proxify also URL inside meta http-equiv="refresh", i.e: <meta http-equiv="refresh" content="0; url=/baidu.html?from=noscript"/>

webaddicto commented 7 years ago

In the last commit I updated the regex to better extract the url from the meta refresh, example:

<META http-equiv="refresh" content="0;URL='http://www.website.com/'">
<META http-equiv="refresh" content="0;URL='http://www.website.com/'">
<meta http-equiv="refresh" content='0; url='/baidu.html?from=noscript"'/>
<noscript><META http-equiv="refresh" content="0;URL='http://www.website.com/'"></noscript>
<noscript><META http-equiv="refresh" content="0;URL='http://www.website.com/'"></noscript>
<noscript><META http-equiv="refresh" content="0;URL=http://www.website.com"/></noscript>

Will extract the url on $matches[3] like this:

Array
(
    [0] => <META http-equiv="refresh" content="0;URL='http://www.website.com/'"
    [1] => "
    [2] => '
    [3] => http://www.website.com/
    [4] => '
)
Array
(
    [0] => <META http-equiv="refresh" content="0;URL='http://www.website.com/'"
    [1] => "
    [2] => '
    [3] => http://www.website.com/
    [4] => '
)
Array
(
    [0] => <meta http-equiv="refresh" content='0; url='/baidu.html?from=noscript"'
    [1] => '
    [2] => '
    [3] => /baidu.html?from=noscript
    [4] => "
)
Array
(
    [0] => <META http-equiv="refresh" content="0;URL='http://www.website.com/'"
    [1] => "
    [2] => '
    [3] => http://www.website.com/
    [4] => '
)
Array
(
    [0] => <META http-equiv="refresh" content="0;URL='http://www.website.com/'"
    [1] => "
    [2] => '
    [3] => http://www.website.com/
    [4] => '
)
Array
(
    [0] => <META http-equiv="refresh" content="0;URL=http://www.website.com"
    [1] => "
    [2] => 
    [3] => http://www.website.com
    [4] => 
)
webaddicto commented 7 years ago

Added by the author on commit f182fd0