]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Closes #1119: If post data not initially found then input stream is used.
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 13 Jul 2009 10:40:15 +0000 (10:40 +0000)
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 13 Jul 2009 10:40:15 +0000 (10:40 +0000)
git-svn-id: https://code.elgg.org/elgg/trunk@3403 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/api.php

index ad1503f63d504a4f151c9eef77fc1a1a315980bb..213670906fc759b2f2b6a5521cf5cdcb772f9c57 100644 (file)
        {
                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 //////////////////////////////////////////////////////////////////////////