Changeset 49405 for branches/4.1/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 10/29/2020 07:09:27 PM (4 years ago)
- Location:
- branches/4.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.1
- Property svn:mergeinfo changed
/branches/5.5 (added) merged: 49373-49379,49381 /trunk merged: 49380,49382-49388
- Property svn:mergeinfo changed
-
branches/4.1/src/wp-includes/class-wp-xmlrpc-server.php
r40699 r49405 3293 3293 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 3294 3294 3295 if ( 3296 'publish' === get_post_status( $post_id ) && 3297 ! current_user_can( 'edit_post', $post_id ) && 3298 post_password_required( $post_id ) 3299 ) { 3300 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3301 } 3302 3303 if ( 3304 'private' === get_post_status( $post_id ) && 3305 ! current_user_can( 'read_post', $post_id ) 3306 ) { 3307 return new IXR_Error( 403, __( 'Sorry, you are not allowed to comment on this post.' ) ); 3308 } 3309 3295 3310 $comment = array(); 3296 3311 $comment['comment_post_ID'] = $post_id; … … 3609 3624 do_action( 'xmlrpc_call', 'wp.getMediaItem' ); 3610 3625 3611 if ( ! $attachment = get_post($attachment_id) ) 3626 $attachment = get_post( $attachment_id ); 3627 if ( ! $attachment || 'attachment' !== $attachment->post_type ) { 3612 3628 return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); 3629 } 3613 3630 3614 3631 return $this->_prepare_media_item( $attachment );
Note: See TracChangeset
for help on using the changeset viewer.