Ticket #38822: 38822.3.patch
| File 38822.3.patch, 987 bytes (added by , 9 years ago) |
|---|
-
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
379 379 380 380 if ( isset( $request['author_ip'] ) && ! current_user_can( 'moderate_comments' ) ) { 381 381 if ( empty( $_SERVER['REMOTE_ADDR'] ) || $request['author_ip'] !== $_SERVER['REMOTE_ADDR'] ) { 382 return new WP_Error( 'rest_comment_invalid_author_ip', __( 'Sorry, you are not allowed to set author_ip for comments.' ), array( 'status' => rest_authorization_required_code() ) ); 382 /* translators: %s: request parameter */ 383 return new WP_Error( 'rest_comment_invalid_author_ip', sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'author_ip' ), array( 'status' => rest_authorization_required_code() ) ); 383 384 } 384 385 } 385 386