Code Duplication    Length = 7-7 lines in 2 locations

class.jetpack-network.php 1 location

@@ 421-427 (lines=7) @@
418
		// Save the secrets in the subsite so when the wpcom server does a pingback it
419
		// will be able to validate the connection
420
		$secrets = $jp->generate_secrets( 'register' );
421
		if (
422
			empty( $secrets['secret_1'] ) ||
423
			empty( $secrets['secret_2']  ) ||
424
			empty( $secrets['exp'] )
425
		) {
426
			return new Jetpack_Error( 'missing_secrets' );
427
		}
428
429
		// Gra info for gmt offset
430
		$gmt_offset = get_option( 'gmt_offset' );

class.jetpack.php 1 location

@@ 5136-5142 (lines=7) @@
5133
		add_action( 'pre_update_jetpack_option_register', array( 'Jetpack_Options', 'delete_option' ) );
5134
		$secrets = Jetpack::generate_secrets( 'register' );
5135
5136
		if (
5137
			empty( $secrets['secret_1'] ) ||
5138
			empty( $secrets['secret_2'] ) ||
5139
			empty( $secrets['exp'] )
5140
		) {
5141
			return new Jetpack_Error( 'missing_secrets' );
5142
		}
5143
5144
		// better to try (and fail) to set a higher timeout than this system
5145
		// supports than to have register fail for more users than it should