Support IPv6.
authorlace <>
Wed, 14 Jul 2010 08:19:30 +0000 (08:19 +0000)
committerlace <>
Wed, 14 Jul 2010 08:19:30 +0000 (08:19 +0000)
Support postget.time().

public_html/cgi-bin/postget.php

index 9e8677f..2975031 100644 (file)
@@ -7,7 +7,7 @@
 
        foreach ($_REQUEST as $key=>$val) {
                if (ereg("^_priv_(postget.*)\$",$val,$matched)) {
-                       $permit=array("127.0.0.1"=>1,"192.168.192.1"=>1,"192.168.90.11"=>1,"192.168.90.12"=>1);
+                       $permit=array("127.0.0.1"=>1,"::1"=>1,"192.168.192.1"=>1,"192.168.90.11"=>1,"192.168.90.12"=>1);
                        if (!$permit[$_SERVER["REMOTE_ADDR"]])
                                print("Forbidden:"
                                                ." REMOTE_ADDR=".htmlspecialchars($_SERVER["REMOTE_ADDR"])
                                                .",val=".htmlspecialchars($val)
                                                ."<br />"
                                                );
+                       elseif ($matched[1]=="postget.time()") {
+                               // At least 2 - time slip?
+                               $_REQUEST[$key]=time()-131-60;
+                       }
                        else
                                $_REQUEST[$key]=chop(join(" ",file($path_priv.$matched[1],false/*use_include_path*/)));
                        }