Code Duplication    Length = 5-5 lines in 2 locations

class.jetpack-xmlrpc-server.php 2 locations

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