From: marcus Date: Mon, 13 Jul 2009 10:40:15 +0000 (+0000) Subject: Closes #1119: If post data not initially found then input stream is used. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=eb6751aaf69275c75cb7fa1382e18de0a1230b71;p=lorea%2Felgg.git 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 --- 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 //////////////////////////////////////////////////////////////////////////