- if ($pp_item->match($ip)) {
- if (isset($headers[$pp_item->headitem])) {
- fprintf(STDERR, "Match public proxy [%s]\n", $pp_name);
- return ($headers[$pp_item->headitem]);
+ // fprintf(STDERR, "PP loop: [%s][%s]\n", $pp_name, $ip);
+ if ($pp_item->ipclass->check($ip)) {
+ if (isset($header[$pp_item->headitem])) {
+ fprintf(STDERR, "PP: match public proxy [%s][%s]\n", $pp_name, $header[$pp_item->headitem]);
+ $ret = $header['POST_'.$pp_item->headitem] = $header[$pp_item->headitem];
+ unset($header[$pp_item->headitem]);
+ return ($ret);