private function parseRequest( $request_xml ) {
		$xml = @simplexml_load_string($request_xml);
		if (!$xml && !$xml->getNamespaces()) { 
			// FIXME: check for protocol json-rpc
			//simplexml in combination with namespaces (soap) lets $xml evaluate to false
			return  xmlrpc_encode_request( 
				null, 
				ripcord::fault( -3, 'Invalid Method Call - Ripcord Server accepts only XML-RPC, SimpleRPC or SOAP 1.1 calls'), 
				$this->outputOptions
			);
		} else {
			// prevent segmentation fault on incorrect xmlrpc request (without methodName)
			$methodCall = $xml->xpath('//methodCall'); 
			if ($methodCall) { //xml-rpc
				$methodName = $xml->xpath('//methodName');
				if (!$methodName) {
					return xmlrpc_encode_request(
						null,
						ripcord::fault( -3, 'Invalid Method Call - No methodName given'),
						$this->outputOptions
					);
				}
			}
		}
		$method = null;
		ob_start(); // xmlrpc_decode echo expat errors if the xml is not valid, can't stop it.
		$params = xmlrpc_decode_request($request_xml, $method);
		ob_end_clean(); // clean up any xml errors
		return array( 'methodName' => $method, 'params' => $params );
	}
private function parseRequest( $request_xml ) {
		$xml = @simplexml_load_string($request_xml);
		if (!$xml && !$xml->getNamespaces()) { 
			// FIXME: check for protocol json-rpc
			//simplexml in combination with namespaces (soap) lets $xml evaluate to false
			return  xmlrpc_encode_request( 
				null, 
				ripcord::fault( -3, 'Invalid Method Call - Ripcord Server accepts only XML-RPC, SimpleRPC or SOAP 1.1 calls'), 
				$this->outputOptions
			);
		} else {
			// prevent segmentation fault on incorrect xmlrpc request (without methodName)
			$methodCall = $xml->xpath('//methodCall'); 
			if ($methodCall) { //xml-rpc
				$methodName = $xml->xpath('//methodName');
				if (!$methodName) {
					return xmlrpc_encode_request(
						null,
						ripcord::fault( -3, 'Invalid Method Call - No methodName given'),
						$this->outputOptions
					);
				}
			}
		}
		$method = null;
		ob_start(); // xmlrpc_decode echo expat errors if the xml is not valid, can't stop it.
		$params = xmlrpc_decode_request($request_xml, $method);
		ob_end_clean(); // clean up any xml errors
		return array( 'methodName' => $method, 'params' => $params );
	}
private function parseRequest ( $ request_xml ) { $ xml = @ simplexml_load_string ( $ request_xml ) ; if ( ! $ xml && ! $ xml -> getNamespaces ( ) ) { // FIXME: check for protocol json-rpc //simplexml in combination with namespaces (soap) lets $xml evaluate to false return xmlrpc_encode_request ( null , ripcord :: fault ( - 3 , 'Invalid Method Call - Ripcord Server accepts only XML-RPC, SimpleRPC or SOAP 1.1 calls' ) , $ this -> outputOptions ) ; } else { // prevent segmentation fault on incorrect xmlrpc request (without methodName) $ methodCall = $ xml -> xpath ( '//methodCall' ) ; if ( $ methodCall ) { //xml-rpc $ methodName = $ xml -> xpath ( '//methodName' ) ; if ( ! $ methodName ) { return xmlrpc_encode_request ( null , ripcord :: fault ( - 3 , 'Invalid Method Call - No methodName given' ) , $ this -> outputOptions ) ; } } } $ method = null ; ob_start ( ) ; // xmlrpc_decode echo expat errors if the xml is not valid, can't stop it. $ params = xmlrpc_decode_request ( $ request_xml , $ method ) ; ob_end_clean ( ) ; // clean up any xml errors return array ( 'methodName' => $ method , 'params' => $ params ) ; }
This method wraps around xmlrpc_decode_request, since it is borken in many ways. This wraps
around all the ugliness needed to make it not dump core and not print expat warnings.
This method wraps around xmlrpc_decode_request since it is borken in many ways . This wraps around all the ugliness needed to make it not dump core and not print expat warnings .