replaced removed HTTP_RAW_POST_DATA with php input stream
authorMattias Michaux <mattias.michaux@gmail.com>
Wed, 1 Jun 2016 20:26:40 +0000 (22:26 +0200)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 14 Sep 2016 00:53:21 +0000 (10:53 +1000)
CRM/Report/Form.php
extern/soap.php

index ccbaea07be552c104879a2e478fa419b4212de8a..710a51b05e74fe3517749e46075f1d47c20e1d64 100644 (file)
@@ -4620,12 +4620,9 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a
     // upload strictly for '.png' images
     $name = trim(basename(CRM_Utils_Request::retrieve('name', 'String', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'GET')));
     if (preg_match('/\.png$/', $name)) {
-      //
-      // POST data is usually string data, but we are passing a RAW .png
-      // so PHP is a bit confused and $_POST is empty. But it has saved
-      // the raw bits into $HTTP_RAW_POST_DATA
-      //
-      $httpRawPostData = $GLOBALS['HTTP_RAW_POST_DATA'];
+
+      // Get the RAW .png from the input.
+      $httpRawPostData = file_get_contents("php://input");
 
       // prepare the directory
       $config = CRM_Core_Config::singleton();
index 0f5bd2081a82d322f412757966a00f6d75e4344d..ab8664d70a4cb34bd42eed0abf8715a423fc0f42 100644 (file)
  +--------------------------------------------------------------------+
  */
 
-
-// Patch for CRM-3154
-if (phpversion() == "5.2.2" &&
-  !isset($GLOBALS['HTTP_RAW_POST_DATA'])
-) {
-  $GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents('php://input');
-}
-
 if (defined('PANTHEON_ENVIRONMENT')) {
   ini_set('session.save_handler', 'files');
 }