From a3501e591296bccb42f9c742aec445b65b9669c9 Mon Sep 17 00:00:00 2001 From: tailor Date: Sat, 31 Mar 2007 00:40:31 +0000 Subject: [project @ Make sure getQuery fails gracefully on no php://input] --- Auth/OpenID.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Auth/OpenID.php b/Auth/OpenID.php index eeb540a..66a1c46 100644 --- a/Auth/OpenID.php +++ b/Auth/OpenID.php @@ -128,7 +128,8 @@ class Auth_OpenID { * Skips invalid key/value pairs (i.e. keys with no '=value' * portion). * - * Returns an empty array if neither GET nor POST was used. + * Returns an empty array if neither GET nor POST was used, or if + * POST was used but php://input cannot be opened. */ function getQuery($query_str=null) { @@ -138,6 +139,10 @@ class Auth_OpenID { $str = $_SERVER['QUERY_STRING']; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $str = file_get_contents('php://input'); + + if ($str === false) { + return array(); + } } else { return array(); } -- cgit v1.1