@@ 601-608 (lines=8) @@ | ||
598 | // Hack to preserve $HTTP_RAW_POST_DATA |
|
599 | add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
|
600 | ||
601 | if ( $this->verify_xml_rpc_signature() ) { |
|
602 | // The actual API methods. |
|
603 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
|
604 | } else { |
|
605 | // The jetpack.authorize method should be available for unauthenticated users on a site with an |
|
606 | // active Jetpack connection, so that additional users can link their account. |
|
607 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
608 | } |
|
609 | } else { |
|
610 | new XMLRPC_Connector( $this->connection_manager ); |
|
611 | ||
@@ 609-619 (lines=11) @@ | ||
606 | // active Jetpack connection, so that additional users can link their account. |
|
607 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
608 | } |
|
609 | } else { |
|
610 | new XMLRPC_Connector( $this->connection_manager ); |
|
611 | ||
612 | // The bootstrap API methods. |
|
613 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
614 | ||
615 | if ( $this->verify_xml_rpc_signature() ) { |
|
616 | // the jetpack Provision method is available for blog-token-signed requests |
|
617 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
|
618 | } |
|
619 | } |
|
620 | ||
621 | // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
|
622 | add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |