Commit a5f3c897 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1693559: Fixing php7 compatibility errors"

parents 8b55dabe 4a292254
......@@ -65,15 +65,11 @@ header('Content-type: text/xml; charset=utf-8');
ini_set('display_errors',0);
if (!empty($errors)) throw new XmlrpcServerException('Initialization failed. Non-recoverable error.', 6000);
// PHP 5.2.2: $HTTP_RAW_POST_DATA not populated bug:
// http://bugs.php.net/bug.php?id=41293
if (empty($HTTP_RAW_POST_DATA)) {
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
}
$rawHTTPdata = file_get_contents('php://input');
// A singleton provides our site's SSL info
$openssl = OpenSslRepo::singleton();
$payload = $HTTP_RAW_POST_DATA;
$payload = $rawHTTPdata;
$payload_encrypted = false;
$payload_signed = false;
......
......@@ -221,7 +221,7 @@ class webservice_soap_client_wsse extends Zend_Soap_Client_Common {
* see, if you want to add more headers, the method needs to be modifyed
*/
public function __soapCall($function_name, $arguments, $options=null,
$input_headers=null, $output_headers=null) {
$input_headers=null, &$output_headers=null) {
$result = parent::__soapCall($function_name, $arguments, $options,
$this->wssecurity_header());
......
......@@ -286,9 +286,9 @@ class webservice_soap_server extends webservice_zend_server {
if (!empty($this->publickey)) {
// A singleton provides our site's SSL info
require_once(get_config('docroot') . 'api/xmlrpc/lib.php');
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
$rawHTTPdata = file_get_contents('php://input');
$openssl = OpenSslRepo::singleton();
$payload = $HTTP_RAW_POST_DATA;
$payload = $rawHTTPdata;
$this->payload_encrypted = false;
$this->payload_signed = false;
......
......@@ -462,8 +462,6 @@ class webservice_xmlrpc_server extends webservice_zend_server {
* @return $xml
*/
protected function modify_payload() {
global $HTTP_RAW_POST_DATA;
$xml = null;
// check for encryption and signatures
......@@ -496,12 +494,12 @@ class webservice_xmlrpc_server extends webservice_zend_server {
}
// only both if we can find a public key
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
$rawHTTPdata = file_get_contents('php://input');
if (!empty($this->publickey)) {
// A singleton provides our site's SSL info
require_once(get_config('docroot') . 'api/xmlrpc/lib.php');
$openssl = OpenSslRepo::singleton();
$payload = $HTTP_RAW_POST_DATA;
$payload = $rawHTTPdata;
$this->payload_encrypted = false;
$this->payload_signed = false;
......@@ -544,7 +542,7 @@ class webservice_xmlrpc_server extends webservice_zend_server {
}
}
else {
$payload = $HTTP_RAW_POST_DATA;
$payload = $rawHTTPdata;
}
// if XML has been grabbed already then it must be turned into a request object
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment