Code Duplication    Length = 3-3 lines in 2 locations

sal/class.json-api-site-base.php 1 location

@@ 321-323 (lines=3) @@
318
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
319
		}
320
321
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
322
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
323
		}
324
325
		return true;
326
	}

class.json-api-endpoints.php 1 location

@@ 1127-1129 (lines=3) @@
1124
			);
1125
		}
1126
1127
		if ( strlen( $post->post_password ) && ! current_user_can( 'edit_post', $post->ID ) ) {
1128
			return new WP_Error(
1129
				'unauthorized',
1130
				'User cannot view password protected post',
1131
				array(
1132
					'status_code' => 403,