Code Duplication    Length = 3-3 lines in 2 locations

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
	}

class.json-api-endpoints.php 1 location

@@ 1010-1012 (lines=3) @@
1007
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
1008
		}
1009
1010
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
1011
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
1012
		}
1013
1014
		return true;
1015
	}