Code Duplication    Length = 5-5 lines in 2 locations

class.jetpack-xmlrpc-server.php 2 locations

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