// 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();
+--------------------------------------------------------------------+
*/
-
-// 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');
}