Code Duplication    Length = 8-9 lines in 2 locations

class.jetpack.php 2 locations

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