Code Duplication    Length = 8-11 lines in 2 locations

class.jetpack.php 2 locations

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