Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 271-273 (lines=3) @@
268
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
269
		}
270
271
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
272
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
273
		}
274
275
		return true;
276
	}

class.json-api-endpoints.php 1 location

@@ 1046-1048 (lines=3) @@
1043
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
1044
		}
1045
1046
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
1047
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
1048
		}
1049
1050
		return true;
1051
	}