Code Duplication    Length = 8-11 lines in 2 locations

class.jetpack.php 2 locations

@@ 615-622 (lines=8) @@
612
				// Hack to preserve $HTTP_RAW_POST_DATA
613
				add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) );
614
615
				if ( $this->verify_xml_rpc_signature() ) {
616
					// The actual API methods.
617
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) );
618
				} else {
619
					// The jetpack.authorize method should be available for unauthenticated users on a site with an
620
					// active Jetpack connection, so that additional users can link their account.
621
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
622
				}
623
			} else {
624
				new XMLRPC_Connector( $this->connection_manager );
625
@@ 623-633 (lines=11) @@
620
					// active Jetpack connection, so that additional users can link their account.
621
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
622
				}
623
			} else {
624
				new XMLRPC_Connector( $this->connection_manager );
625
626
				// The bootstrap API methods.
627
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
628
629
				if ( $this->verify_xml_rpc_signature() ) {
630
					// the jetpack Provision method is available for blog-token-signed requests
631
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) );
632
				}
633
			}
634
635
			// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on.
636
			add_filter( 'pre_option_enable_xmlrpc', '__return_true' );