Code Duplication    Length = 8-9 lines in 2 locations

class.jetpack.php 2 locations

@@ 562-569 (lines=8) @@
559
				add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) );
560
561
				$signed = $this->verify_xml_rpc_signature();
562
				if ( $signed && ! is_wp_error( $signed ) ) {
563
					// The actual API methods.
564
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) );
565
				} else {
566
					// The jetpack.authorize method should be available for unauthenticated users on a site with an
567
					// active Jetpack connection, so that additional users can link their account.
568
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
569
				}
570
			} else {
571
				// The bootstrap API methods.
572
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
@@ 570-578 (lines=9) @@
567
					// active Jetpack connection, so that additional users can link their account.
568
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
569
				}
570
			} else {
571
				// The bootstrap API methods.
572
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
573
				$signed = $this->verify_xml_rpc_signature();
574
				if ( $signed && ! is_wp_error( $signed ) ) {
575
					// the jetpack Provision method is available for blog-token-signed requests
576
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) );
577
				}
578
			}
579
580
			// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on.
581
			add_filter( 'pre_option_enable_xmlrpc', '__return_true' );