Code Duplication    Length = 8-9 lines in 2 locations

class.jetpack.php 2 locations

@@ 548-555 (lines=8) @@
545
				add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) );
546
547
				$signed = $this->verify_xml_rpc_signature();
548
				if ( $signed && ! is_wp_error( $signed ) ) {
549
					// The actual API methods.
550
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) );
551
				} else {
552
					// The jetpack.authorize method should be available for unauthenticated users on a site with an
553
					// active Jetpack connection, so that additional users can link their account.
554
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
555
				}
556
			} else {
557
				// The bootstrap API methods.
558
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
@@ 556-564 (lines=9) @@
553
					// active Jetpack connection, so that additional users can link their account.
554
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
555
				}
556
			} else {
557
				// The bootstrap API methods.
558
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
559
				$signed = $this->verify_xml_rpc_signature();
560
				if ( $signed && ! is_wp_error( $signed ) ) {
561
					// the jetpack Provision method is available for blog-token-signed requests
562
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) );
563
				}
564
			}
565
566
			// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on.
567
			add_filter( 'pre_option_enable_xmlrpc', '__return_true' );