Mercurial > hg > anonet-resdb
comparison doc/www.powerfulproxy.com/public_html/do_it.php @ 502:60ece78f8b36 draft
added host and IP verification to powerfulproxy
author | Nick <nick@somerandomnick.ano> |
---|---|
date | Wed, 11 May 2011 05:30:41 +0000 |
parents | 4d73737f40ff |
children | 1ca0de1bb813 |
comparison
equal
deleted
inserted
replaced
501:4d73737f40ff | 502:60ece78f8b36 |
---|---|
7 $pall = explode("/", $_SERVER['PATH_INFO']); | 7 $pall = explode("/", $_SERVER['PATH_INFO']); |
8 if (count($pall) <= 1) die('Unexpected path format'); | 8 if (count($pall) <= 1) die('Unexpected path format'); |
9 array_shift($pall); | 9 array_shift($pall); |
10 $proto = array_shift($pall); | 10 $proto = array_shift($pall); |
11 $host = array_shift($pall); | 11 $host = array_shift($pall); |
12 $hostparts = explode('.', $host); | |
13 if (ip2long(long2ip($host))===$host) if ($hostparts[0]!='1') die('Bad IP'); | |
14 if (!preg_match("/ano|ntwrk$/",array_pop($hostparts))) die('Bad host'); | |
12 $path = implode('/', $pall); | 15 $path = implode('/', $pall); |
13 array_pop($pall); | 16 array_pop($pall); |
14 $rp = implode('/', $pall); | 17 $rp = implode('/', $pall); |
15 | 18 |
16 /* CONFIGURATION */ | 19 /* CONFIGURATION */ |