Affects Version/s: 2.9.4
Fix Version/s: 2.9.6
Testing Instructions:Search for usages of the variables: $_GLOBALS["HTTP_RAW_POST_DATA"] $HTTP_RAW_POST_DATA Make sure the only usage is on Zend library and TinyMCE . Setup MNET, add a peer and make sure you don't get the error: Request for http://glux/mdk/mnet29b returned empty response line 134 of /mnet/lib.php: call to debugging() line 115 of /admin/mnet/peers.php: call to mnet_get_public_key() Would be really good, if someone that has php 5.6 and see if you get any HTTP_RAW_POST_DATA errors on AJAX web service requests.
Pull from Repository:
Summary: I would like the patch 4d16a2749f8b5d6dd2858106b5cae5e383256fa7 by Simey Lameze in
MDL-51162 backported to pre-3.0 branches - or at least its MNet part. Without it, the XMLRPC communication in MNet does not work in certain situations as the XML payload is broken by prepended deprecation message.
While debugging some other issue in MNet, I realized that I am not able to add an MNet peer. What I saw was debugging message like
I was able to trace it down to a place where the host attempts to call
in mnet_get_public_key(). The trouble is that the response returned by curl_exec() contained the debugging message:
PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
which breaks the XML structure and xmlrpc_decode() returns empty string:
This deprecation warning is raised in PHP 5.6 and in PHP 7.0 the functionality is completely removed. It was already noticed by Andrew Nicols and the legacy global variable was replaced in Moodle 3.0 in
I believe we should backport that fix though as this effectively makes MNet unusable on PHP 5.6 sites with some level of debugging enabled. It probably does not affect production sites that have debugging disabled.
If you are experiencing the error above, please add the setting always_populate_raw_post_data = -1 to your php.ini.
For more information see: https://docs.moodle.org/29/en/PHP#HTTP_RAW_POST_DATA_errors