Code Duplication    Length = 8-11 lines in 2 locations

class.jetpack.php 2 locations

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