Code Duplication    Length = 5-5 lines in 2 locations

class.jetpack-xmlrpc-server.php 2 locations

@@ 85-89 (lines=5) @@
82
	}
83
84
	function activate_manage( $request ) {
85
		foreach( array( 'secret', 'state' ) as $required ) {
86
			if ( ! isset( $request[ $required ] ) || empty( $request[ $required ] ) ) {
87
				return $this->error( new Jetpack_Error( 'missing_parameter', 'One or more parameters is missing from the request.', 400 ) );
88
			}
89
		}
90
		$verified = $this->verify_action( array( 'activate_manage', $request['secret'], $request['state'] ) );
91
		if ( is_a( $verified, 'IXR_Error' ) ) {
92
			return $verified;
@@ 102-106 (lines=5) @@
99
	}
100
101
	function remote_authorize( $request ) {
102
		foreach( array( 'secret', 'state', 'redirect_uri', 'code' ) as $required ) {
103
			if ( ! isset( $request[ $required ] ) || empty( $request[ $required ] ) ) {
104
				return $this->error( new Jetpack_Error( 'missing_parameter', 'One or more parameters is missing from the request.', 400 ) );
105
			}
106
		}
107
108
		if ( ! get_user_by( 'id', $request['state'] ) ) {
109
			return $this->error( new Jetpack_Error( 'user_unknown', 'User not found.', 404 ) );