Code Duplication    Length = 8-9 lines in 2 locations

class.jetpack.php 2 locations

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