@@ 591-598 (lines=8) @@ | ||
588 | add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
|
589 | ||
590 | $signed = $this->verify_xml_rpc_signature(); |
|
591 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
592 | // The actual API methods. |
|
593 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
|
594 | } else { |
|
595 | // The jetpack.authorize method should be available for unauthenticated users on a site with an |
|
596 | // active Jetpack connection, so that additional users can link their account. |
|
597 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
598 | } |
|
599 | } else { |
|
600 | // The bootstrap API methods. |
|
601 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
@@ 599-607 (lines=9) @@ | ||
596 | // active Jetpack connection, so that additional users can link their account. |
|
597 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
598 | } |
|
599 | } else { |
|
600 | // The bootstrap API methods. |
|
601 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
602 | $signed = $this->verify_xml_rpc_signature(); |
|
603 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
604 | // the jetpack Provision method is available for blog-token-signed requests |
|
605 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
|
606 | } |
|
607 | } |
|
608 | ||
609 | // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
|
610 | add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |