-
Bug
-
Resolution: Fixed
-
Critical
-
2.9.4
-
MOODLE_29_STABLE
-
MOODLE_29_STABLE
-
Summary: I would like the patch 4d16a2749f8b5d6dd2858106b5cae5e383256fa7 by 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.
Details:
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
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()
|
I was able to trace it down to a place where the host attempts to call
$res = xmlrpc_decode(curl_exec($ch));
|
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 dobedobedoh and the legacy global variable was replaced in Moodle 3.0 in MDL-51162.
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.
Some users are experiencing the HTTP_RAW_POST_DATA related errors:
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()
|
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