@@ 551-558 (lines=8) @@ | ||
548 | add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
|
549 | ||
550 | $signed = $this->verify_xml_rpc_signature(); |
|
551 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
552 | // The actual API methods. |
|
553 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
|
554 | } else { |
|
555 | // The jetpack.authorize method should be available for unauthenticated users on a site with an |
|
556 | // active Jetpack connection, so that additional users can link their account. |
|
557 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
558 | } |
|
559 | } else { |
|
560 | // The bootstrap API methods. |
|
561 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
@@ 559-567 (lines=9) @@ | ||
556 | // active Jetpack connection, so that additional users can link their account. |
|
557 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
558 | } |
|
559 | } else { |
|
560 | // The bootstrap API methods. |
|
561 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
562 | $signed = $this->verify_xml_rpc_signature(); |
|
563 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
564 | // the jetpack Provision method is available for blog-token-signed requests |
|
565 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
|
566 | } |
|
567 | } |
|
568 | ||
569 | // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
|
570 | add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |