summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php')
-rw-r--r--plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php b/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php
index d3424c14..74562322 100644
--- a/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php
+++ b/plugins/jetpack/json-endpoints/class.wpcom-json-api-comment-endpoint.php
@@ -74,9 +74,9 @@ abstract class WPCOM_JSON_API_Comment_Endpoint extends WPCOM_JSON_API_Endpoint {
case 'display' :
if ( 'approved' !== $status ) {
$current_user_id = get_current_user_id();
- $user_can_read_coment = false;
+ $user_can_read_comment = false;
if ( $current_user_id && $comment->user_id && $current_user_id == $comment->user_id ) {
- $user_can_read_coment = true;
+ $user_can_read_comment = true;
} elseif (
$comment->comment_author_email && $comment->comment_author
&&
@@ -88,12 +88,12 @@ abstract class WPCOM_JSON_API_Comment_Endpoint extends WPCOM_JSON_API_Endpoint {
&&
$this->api->token_details['user']['display_name'] === $comment->comment_author
) {
- $user_can_read_coment = true;
+ $user_can_read_comment = true;
} else {
- $user_can_read_coment = current_user_can( 'edit_comment', $comment->comment_ID );
+ $user_can_read_comment = current_user_can( 'edit_posts' );
}
- if ( !$user_can_read_coment ) {
+ if ( !$user_can_read_comment ) {
return new WP_Error( 'unauthorized', 'User cannot read unapproved comment', 403 );
}
}