From eb6751aaf69275c75cb7fa1382e18de0a1230b71 Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 13 Jul 2009 10:40:15 +0000 Subject: Closes #1119: If post data not initially found then input stream is used. git-svn-id: https://code.elgg.org/elgg/trunk@3403 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/api.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/lib/api.php b/engine/lib/api.php index ad1503f63..213670906 100644 --- a/engine/lib/api.php +++ b/engine/lib/api.php @@ -822,7 +822,15 @@ { global $GLOBALS; - return $GLOBALS['HTTP_RAW_POST_DATA']; + $postdata = $GLOBALS['HTTP_RAW_POST_DATA']; + + // Attempt another method to return post data (incase always_populate_raw_post_data is switched off) + if (!$postdata) + { + $postdata = file_get_contents('php://input'); + } + + return $postdata; } // PAM functions ////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3