From: Rudolf Polzer Date: Fri, 26 Nov 2010 19:36:55 +0000 (+0100) Subject: update PHP script to also support signed GET X-Git-Tag: xonotic-v0.1.0preview~28 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=76ca5dac748fead9b3feaff2fdd764473d814d7b update PHP script to also support signed GET --- diff --git a/misc/infrastructure/php/d0_blind_id.inc b/misc/infrastructure/php/d0_blind_id.inc index ff35e952..c30f8a38 100644 --- a/misc/infrastructure/php/d0_blind_id.inc +++ b/misc/infrastructure/php/d0_blind_id.inc @@ -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(