Changeset 41927 for trunk/src/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 10/18/2017 09:11:47 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r41574 r41927 3138 3138 3139 3139 // Make sure the user is allowed to add a category. 3140 if ( !current_user_can('manage_categories') ) 3141 return new IXR_Error(401, __('Sorry, you are not allowed to add a category.')); 3140 if ( ! current_user_can( 'manage_categories' ) ) { 3141 return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a category.' ) ); 3142 } 3142 3143 3143 3144 // If no slug was provided make it empty so that … … 3213 3214 do_action( 'xmlrpc_call', 'wp.deleteCategory' ); 3214 3215 3215 if ( !current_user_can('manage_categories') ) 3216 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete a category.' ) ); 3216 if ( ! current_user_can( 'delete_term', $category_id ) ) { 3217 return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this category.' ) ); 3218 } 3217 3219 3218 3220 $status = wp_delete_term( $category_id, 'category' ); … … 3443 3445 } 3444 3446 3445 if ( ! current_user_can( 'edit_comment', $comment_ID ) ) {3446 return new IXR_Error( 403, __( 'Sorry, you are not allowed to moderate or editthis comment.' ) );3447 if ( ! current_user_can( 'edit_comment', $comment_ID ) ) { 3448 return new IXR_Error( 403, __( 'Sorry, you are not allowed to delete this comment.' ) ); 3447 3449 } 3448 3450
Note: See TracChangeset
for help on using the changeset viewer.