Code Duplication    Length = 5-5 lines in 2 locations

class.jetpack-xmlrpc-server.php 2 locations

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