Code Duplication    Length = 3-3 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 991-993 (lines=3) @@
988
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
989
		}
990
991
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
992
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
993
		}
994
995
		return true;
996
	}

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

@@ 238-240 (lines=3) @@
235
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
236
		}
237
238
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
239
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
240
		}
241
242
		return true;
243
	}