Code Duplication    Length = 8-9 lines in 2 locations

class.jetpack.php 2 locations

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