mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
XML-RPC: Emit an appropriate HTTP status code when an error is returned in response to an XML-RPC request.
This most notably affects the response when XML-RPC is disabled or when the supplied username and password is incorrect. Props ericmann Fixes #48213 git-svn-id: https://develop.svn.wordpress.org/trunk@49862 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -16,6 +16,15 @@ class Tests_XMLRPC_Basic extends WP_XMLRPC_UnitTestCase {
|
||||
$this->assertSame( 403, $result->code );
|
||||
}
|
||||
|
||||
function test_disabled() {
|
||||
add_filter( 'xmlrpc_enabled', '__return_false' );
|
||||
|
||||
$result = $this->myxmlrpcserver->wp_getOptions( array( 1, 'username', 'password' ) );
|
||||
|
||||
$this->assertIXRError( $result );
|
||||
$this->assertSame( 405, $result->code );
|
||||
}
|
||||
|
||||
function test_login_pass_ok() {
|
||||
$user_id = $this->make_user_by_role( 'subscriber' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user