summaryrefslogtreecommitdiffstats
path: root/Auth
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-03-31 00:40:31 +0000
committertailor <cygnus@janrain.com>2007-03-31 00:40:31 +0000
commita3501e591296bccb42f9c742aec445b65b9669c9 (patch)
treee83ad9649e8ac4ced42343be600b30014453d88f /Auth
parent40d447299895f5769ed77d09ec03bb314d261f8f (diff)
downloadphp-openid-a3501e591296bccb42f9c742aec445b65b9669c9.zip
php-openid-a3501e591296bccb42f9c742aec445b65b9669c9.tar.gz
php-openid-a3501e591296bccb42f9c742aec445b65b9669c9.tar.bz2
[project @ Make sure getQuery fails gracefully on no php://input]
Diffstat (limited to 'Auth')
-rw-r--r--Auth/OpenID.php7
1 files changed, 6 insertions, 1 deletions
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();
}