]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
update PHP script to also support signed GET
authorRudolf Polzer <divverent@alientrap.org>
Fri, 26 Nov 2010 19:36:55 +0000 (20:36 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 26 Nov 2010 19:36:55 +0000 (20:36 +0100)
misc/infrastructure/php/d0_blind_id.inc

index ff35e9520c35b4c3a7ba6876c90d711eebcba881..c30f8a38b79504a26d90dae834078bd721cb53a3 100644 (file)
@@ -16,9 +16,10 @@ function d0_blind_id_verify()
        global $d0_blind_id_keygen;
        global $d0_blind_id_d0pk;
 
-       $postdata = file_get_contents("php://input");
-       if($postdata === false)
-               die("Cannot read from input");
+       if($_SERVER["REQUEST_METHOD"] == "POST")
+               $data = file_get_contents("php://input") . "\0" . $_SERVER["QUERY_STRING"];
+       else
+               $data = $_SERVER["QUERY_STRING"];
        $sig = $_SERVER["HTTP_X_D0_BLIND_ID_DETACHED_SIGNATURE"];
        if($sig)
        {
@@ -41,7 +42,7 @@ function d0_blind_id_verify()
                        die("Cannot start process");
                $outfh = $pipes[1];
                $buffers = array(
-                               4 => $postdata,
+                               4 => $data,
                                5 => base64_decode($sig)
                                );
                $rpipes = array(