Code Duplication    Length = 5-5 lines in 2 locations

class.jetpack-xmlrpc-server.php 2 locations

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