- π³π±Netherlands megachriz
I've worked on this and used #897142: XML-RPC introspection protocol breaks for servers that donβt provide signatures β as inspiration.
I've fixed that when calling "system.methodSignature" for a method that has no signature, the string "undef" gets returned and that there is no XML-RPC error.
Warnings logged
Previously, if a XML-RPC method was defined in the complex format, but without a signature defined, you would get the following warnings logged:
Undefined array key 2 in xmlrpc_server()
Undefined array key 3 in xmlrpc_server()With the change from the patch signature and help have become optional in the complex format. But method name and callback remain required. Therefore I added that a warning must be logged if the XML-RPC method is not correctly defined. When it is missing the method name or callback, it now results into the following logged message with a suggestion of how to fix it:
Wrongly defined XML-RPC method detected. Check implementations of hook_xmlrpc() and hook_xmlrpc_alter() to see which one is wrong.
Signaure is not an array
When a signature is defined, but it is not an array, there is still a XML-RPC error. This time the error message is as follows, with the word 'correctly' being added:
'Server error. Requested method @methodname signature not correctly specified.'
Instead of it being a -32601 error, it is now a -32602 error. On https://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php it is said that that code means "-32602 ---> server error. invalid method parameters". One of the parameters is invalid if the signature is not defined as an array, so it looks me that that error code fits here.
Static class callbacks
I also fixed that static class callbacks can be used for a XML-RPC method:
'test.classCallback' => ['XmlRpcTestClass', 'foo'],
Ideally, this should be fixed in a separate issue, but I wanted to ensure that for the above definition - for which a signature is also not defined - calling the "system.methodSignature" method for it would result into the same.
The test only patch should fail tests. Let's see if the patch passes tests.
The last submitted patch, 3: xmlrpc-897130-tests-only.patch, failed testing. View results β
- last update
over 1 year ago 28 pass - @megachriz opened merge request.
- last update
over 1 year ago 28 pass - last update
over 1 year ago 28 pass -
MegaChriz β
committed be0ded1a on 8.x-1.x
Issue #897130 by MegaChriz: Fixed system.methodSignature should return "...
-
MegaChriz β
committed be0ded1a on 8.x-1.x
- Status changed to Fixed
over 1 year ago 8:23am 6 June 2023 Automatically closed - issue fixed for 2 weeks with no activity.