WordPress.org

Make WordPress Core

Ticket #34521: class-wp-xmlrpc-server.php.patch

File class-wp-xmlrpc-server.php.patch, 25.1 KB (added by ramiy, 6 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    12331233                if ( 'private' === $post_data['post_status'] || ! empty( $post_data['post_password'] ) ) {
    12341234                        // Error if the client tried to stick the post, otherwise, silently unstick.
    12351235                        if ( ! empty( $post_data['sticky'] ) ) {
    1236                                 return new IXR_Error( 401, __( 'Sorry, you cannot stick a private post.' ) );
     1236                                return new IXR_Error( 401, __( 'You are not allowed to stick a private post.' ) );
    12371237                        }
    12381238
    12391239                        if ( $update ) {
     
    12411241                        }
    12421242                } elseif ( isset( $post_data['sticky'] ) )  {
    12431243                        if ( ! current_user_can( $post_type->cap->edit_others_posts ) ) {
    1244                                 return new IXR_Error( 401, __( 'Sorry, you are not allowed to stick this post.' ) );
     1244                                return new IXR_Error( 401, __( 'You are not allowed to stick this post.' ) );
    12451245                        }
    12461246
    12471247                        $sticky = wp_validate_boolean( $post_data['sticky'] );
     
    12811281                        if ( ! get_post( $post_data['ID'] ) )
    12821282                                return new IXR_Error( 401, __( 'Invalid post ID.' ) );
    12831283                        if ( ! current_user_can( 'edit_post', $post_data['ID'] ) )
    1284                                 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
     1284                                return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    12851285                        if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) )
    12861286                                return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
    12871287                } else {
    12881288                        if ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( $post_type->cap->edit_posts ) )
    1289                                 return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
     1289                                return new IXR_Error( 401, __( 'You are not allowed to post on this site.' ) );
    12901290                }
    12911291
    12921292                switch ( $post_data['post_status'] ) {
     
    12951295                                break;
    12961296                        case 'private':
    12971297                                if ( ! current_user_can( $post_type->cap->publish_posts ) )
    1298                                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type' ) );
     1298                                        return new IXR_Error( 401, __( 'You are not allowed to create private posts in this post type' ) );
    12991299                                break;
    13001300                        case 'publish':
    13011301                        case 'future':
    13021302                                if ( ! current_user_can( $post_type->cap->publish_posts ) )
    1303                                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ) );
     1303                                        return new IXR_Error( 401, __( 'You are not allowed to publish posts in this post type' ) );
    13041304                                break;
    13051305                        default:
    13061306                                if ( ! get_post_status_object( $post_data['post_status'] ) )
     
    13091309                }
    13101310
    13111311                if ( ! empty( $post_data['post_password'] ) && ! current_user_can( $post_type->cap->publish_posts ) )
    1312                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to create password protected posts in this post type' ) );
     1312                        return new IXR_Error( 401, __( 'You are not allowed to create password protected posts in this post type' ) );
    13131313
    13141314                $post_data['post_author'] = absint( $post_data['post_author'] );
    13151315                if ( ! empty( $post_data['post_author'] ) && $post_data['post_author'] != $user->ID ) {
     
    13801380                                // Validating term ids.
    13811381                                foreach ( $taxonomies as $taxonomy ) {
    13821382                                        if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) )
    1383                                                 return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
     1383                                                return new IXR_Error( 401, __( 'One of the given taxonomies is not supported by the post type.' ) );
    13841384
    13851385                                        if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
    1386                                                 return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
     1386                                                return new IXR_Error( 401, __( 'You are not allowed to assign a term to one of the given taxonomies.' ) );
    13871387
    13881388                                        $term_ids = $post_data['terms'][$taxonomy];
    13891389                                        $terms[ $taxonomy ] = array();
     
    14041404
    14051405                                foreach ( $taxonomies as $taxonomy ) {
    14061406                                        if ( ! array_key_exists( $taxonomy , $post_type_taxonomies ) )
    1407                                                 return new IXR_Error( 401, __( 'Sorry, one of the given taxonomies is not supported by the post type.' ) );
     1407                                                return new IXR_Error( 401, __( 'One of the given taxonomies is not supported by the post type.' ) );
    14081408
    14091409                                        if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->assign_terms ) )
    1410                                                 return new IXR_Error( 401, __( 'Sorry, you are not allowed to assign a term to one of the given taxonomies.' ) );
     1410                                                return new IXR_Error( 401, __( 'You are not allowed to assign a term to one of the given taxonomies.' ) );
    14111411
    14121412                                        /*
    14131413                                         * For hierarchical taxonomies, we can't assign a term when multiple terms
     
    14361436                                                if ( ! $term ) {
    14371437                                                        // Term doesn't exist, so check that the user is allowed to create new terms.
    14381438                                                        if ( ! current_user_can( $post_type_taxonomies[$taxonomy]->cap->edit_terms ) )
    1439                                                                 return new IXR_Error( 401, __( 'Sorry, you are not allowed to add a term to one of the given taxonomies.' ) );
     1439                                                                return new IXR_Error( 401, __( 'You are not allowed to add a term to one of the given taxonomies.' ) );
    14401440
    14411441                                                        // Create the new term.
    14421442                                                        $term_info = wp_insert_term( $term_name, $taxonomy );
     
    14881488                        return new IXR_Error( 500, $post_ID->get_error_message() );
    14891489
    14901490                if ( ! $post_ID )
    1491                         return new IXR_Error( 401, __( 'Sorry, your entry could not be posted. Something wrong happened.' ) );
     1491                        return new IXR_Error( 401, __( 'Your entry could not be posted. Something wrong happened.' ) );
    14921492
    14931493                return strval( $post_ID );
    14941494        }
     
    16021602                }
    16031603
    16041604                if ( ! current_user_can( 'delete_post', $post_id ) ) {
    1605                         return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this post.' ) );
     1605                        return new IXR_Error( 401, __( 'You are not allowed to delete this post.' ) );
    16061606                }
    16071607
    16081608                $result = wp_delete_post( $post_id );
     
    16991699                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    17001700
    17011701                if ( ! current_user_can( 'edit_post', $post_id ) )
    1702                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     1702                        return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    17031703
    17041704                return $this->_prepare_post( $post, $fields );
    17051705        }
     
    18821882                        return new IXR_Error( 500, $term->get_error_message() );
    18831883
    18841884                if ( ! $term )
    1885                         return new IXR_Error( 500, __( 'Sorry, your term could not be created. Something wrong happened.' ) );
     1885                        return new IXR_Error( 500, __( 'The term could not be created. Something wrong happened.' ) );
    18861886
    18871887                return strval( $term['term_id'] );
    18881888        }
     
    19801980                        return new IXR_Error( 500, $term->get_error_message() );
    19811981
    19821982                if ( ! $term )
    1983                         return new IXR_Error( 500, __( 'Sorry, editing the term failed.' ) );
     1983                        return new IXR_Error( 500, __( 'Failed editing the term.' ) );
    19841984
    19851985                return true;
    19861986        }
     
    20422042                        return new IXR_Error( 500, $term->get_error_message() );
    20432043
    20442044                if ( ! $result )
    2045                         return new IXR_Error( 500, __( 'Sorry, deleting the term failed.' ) );
     2045                        return new IXR_Error( 500, __( 'Failed deleting the term.' ) );
    20462046
    20472047                return $result;
    20482048        }
     
    23802380                do_action( 'xmlrpc_call', 'wp.getUser' );
    23812381
    23822382                if ( ! current_user_can( 'edit_user', $user_id ) )
    2383                         return new IXR_Error( 401, __( 'Sorry, you cannot edit users.' ) );
     2383                        return new IXR_Error( 401, __( 'You are not allowed to edit users.' ) );
    23842384
    23852385                $user_data = get_userdata( $user_id );
    23862386
     
    25112511                do_action( 'xmlrpc_call', 'wp.getProfile' );
    25122512
    25132513                if ( ! current_user_can( 'edit_user', $user->ID ) )
    2514                         return new IXR_Error( 401, __( 'Sorry, you cannot edit your profile.' ) );
     2514                        return new IXR_Error( 401, __( 'You are not allowed to edit your profile.' ) );
    25152515
    25162516                $user_data = get_userdata( $user->ID );
    25172517
     
    25572557                do_action( 'xmlrpc_call', 'wp.editProfile' );
    25582558
    25592559                if ( ! current_user_can( 'edit_user', $user->ID ) )
    2560                         return new IXR_Error( 401, __( 'Sorry, you cannot edit your profile.' ) );
     2560                        return new IXR_Error( 401, __( 'You are not allowed to edit your profile.' ) );
    25612561
    25622562                // holds data of the user
    25632563                $user_data = array();
     
    25912591                        return new IXR_Error( 500, $result->get_error_message() );
    25922592
    25932593                if ( ! $result )
    2594                         return new IXR_Error( 500, __( 'Sorry, the user cannot be updated.' ) );
     2594                        return new IXR_Error( 500, __( 'The user cannot be updated.' ) );
    25952595
    25962596                return true;
    25972597        }
     
    26272627                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    26282628
    26292629                if ( !current_user_can( 'edit_page', $page_id ) )
    2630                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this page.' ) );
     2630                        return new IXR_Error( 401, __( 'You are not allowed to edit this page.' ) );
    26312631
    26322632                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    26332633                do_action( 'xmlrpc_call', 'wp.getPage' );
     
    26682668                        return $this->error;
    26692669
    26702670                if ( !current_user_can( 'edit_pages' ) )
    2671                         return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
     2671                        return new IXR_Error( 401, __( 'You are not allowed to edit pages.' ) );
    26722672
    26732673                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    26742674                do_action( 'xmlrpc_call', 'wp.getPages' );
     
    27622762
    27632763                // Make sure the user can delete pages.
    27642764                if ( !current_user_can('delete_page', $page_id) )
    2765                         return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this page.' ) );
     2765                        return new IXR_Error( 401, __( 'You are not allowed to delete this page.' ) );
    27662766
    27672767                // Attempt to delete the page.
    27682768                $result = wp_delete_post($page_id);
     
    28242824
    28252825                // Make sure the user is allowed to edit pages.
    28262826                if ( !current_user_can('edit_page', $page_id) )
    2827                         return new IXR_Error( 401, __( 'Sorry, you do not have the right to edit this page.' ) );
     2827                        return new IXR_Error( 401, __( 'You are not allowed to edit this page.' ) );
    28282828
    28292829                // Mark this as content for a page.
    28302830                $content['post_type'] = 'page';
     
    28702870                        return $this->error;
    28712871
    28722872                if ( !current_user_can( 'edit_pages' ) )
    2873                         return new IXR_Error( 401, __( 'Sorry, you cannot edit pages.' ) );
     2873                        return new IXR_Error( 401, __( 'You are not allowed to edit pages.' ) );
    28742874
    28752875                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    28762876                do_action( 'xmlrpc_call', 'wp.getPageList' );
     
    29262926                        return $this->error;
    29272927
    29282928                if ( !current_user_can('edit_posts') )
    2929                         return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
     2929                        return new IXR_Error( 401, __( 'You are not allowed to edit posts on this site.' ) );
    29302930
    29312931                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    29322932                do_action( 'xmlrpc_call', 'wp.getAuthors' );
     
    29672967                        return $this->error;
    29682968
    29692969                if ( !current_user_can( 'edit_posts' ) )
    2970                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view tags.' ) );
     2970                        return new IXR_Error( 401, __( 'You must be able to edit posts on this site in order to view tags.' ) );
    29712971
    29722972                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    29732973                do_action( 'xmlrpc_call', 'wp.getKeywords' );
     
    30213021
    30223022                // Make sure the user is allowed to add a category.
    30233023                if ( !current_user_can('manage_categories') )
    3024                         return new IXR_Error(401, __('Sorry, you do not have the right to add a category.'));
     3024                        return new IXR_Error(401, __('You are not allowed to add a category.'));
    30253025
    30263026                // If no slug was provided make it empty so that
    30273027                // WordPress will generate one.
     
    30963096                do_action( 'xmlrpc_call', 'wp.deleteCategory' );
    30973097
    30983098                if ( !current_user_can('manage_categories') )
    3099                         return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete a category.' ) );
     3099                        return new IXR_Error( 401, __( 'You are not allowed to delete a category.' ) );
    31003100
    31013101                $status = wp_delete_term( $category_id, 'category' );
    31023102
     
    31433143                        return $this->error;
    31443144
    31453145                if ( !current_user_can( 'edit_posts' ) )
    3146                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
     3146                        return new IXR_Error( 401, __( 'You must be able to edit posts on this site in order to view categories.' ) );
    31473147
    31483148                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    31493149                do_action( 'xmlrpc_call', 'wp.suggestCategories' );
     
    34373437                        return new IXR_Error(500, $result->get_error_message());
    34383438
    34393439                if ( !$result )
    3440                         return new IXR_Error(500, __('Sorry, the comment could not be edited. Something wrong happened.'));
     3440                        return new IXR_Error(500, __('The comment could not be edited. Something wrong happened.'));
    34413441
    34423442                /**
    34433443                 * Fires after a comment has been successfully updated via XML-RPC.
     
    35133513                }
    35143514
    35153515                if ( ! comments_open( $post_id ) ) {
    3516                         return new IXR_Error( 403, __( 'Sorry, comments are closed for this item.' ) );
     3516                        return new IXR_Error( 403, __( 'Comments are closed for this item.' ) );
    35173517                }
    35183518
    35193519                $comment = array();
     
    38893889                        return $this->error;
    38903890
    38913891                if ( !current_user_can( 'upload_files' ) )
    3892                         return new IXR_Error( 403, __( 'You do not have permission to upload files.' ) );
     3892                        return new IXR_Error( 403, __( 'You are not allowed to upload files.' ) );
    38933893
    38943894                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    38953895                do_action( 'xmlrpc_call', 'wp.getMediaItem' );
     
    39373937                        return $this->error;
    39383938
    39393939                if ( !current_user_can( 'upload_files' ) )
    3940                         return new IXR_Error( 401, __( 'You do not have permission to upload files.' ) );
     3940                        return new IXR_Error( 401, __( 'You are not allowed to upload files.' ) );
    39413941
    39423942                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    39433943                do_action( 'xmlrpc_call', 'wp.getMediaLibrary' );
     
    40694069                $post_type = get_post_type_object( $post_type_name );
    40704070
    40714071                if ( ! current_user_can( $post_type->cap->edit_posts ) )
    4072                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post type.' ) );
     4072                        return new IXR_Error( 401, __( 'You are not allowed to edit this post type.' ) );
    40734073
    40744074                return $this->_prepare_post_type( $post_type, $fields );
    40754075        }
     
    41854185                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    41864186
    41874187                if ( ! current_user_can( 'edit_post', $post_id ) )
    4188                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
     4188                        return new IXR_Error( 401, __( 'You are not allowed to edit posts.' ) );
    41894189
    41904190                // Check if revisions are enabled.
    41914191                if ( ! wp_revisions_enabled( $post ) )
     
    42554255                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    42564256
    42574257                if ( ! current_user_can( 'edit_post', $revision->post_parent ) )
    4258                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     4258                        return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    42594259
    42604260                // Check if revisions are disabled.
    42614261                if ( ! wp_revisions_enabled( $post ) )
     
    43714371                        return $this->error;
    43724372
    43734373                if ( !current_user_can( 'edit_posts' ) )
    4374                         return new IXR_Error( 401, __( 'Sorry, you do not have access to user data on this site.' ) );
     4374                        return new IXR_Error( 401, __( 'You do not have access to user data on this site.' ) );
    43754375
    43764376                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    43774377                do_action( 'xmlrpc_call', 'blogger.getUserInfo' );
     
    44174417                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    44184418
    44194419                if ( !current_user_can( 'edit_post', $post_ID ) )
    4420                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     4420                        return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    44214421
    44224422                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    44234423                do_action( 'xmlrpc_call', 'blogger.getPost' );
     
    44704470                        return $this->error;
    44714471
    44724472                if ( ! current_user_can( 'edit_posts' ) )
    4473                         return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
     4473                        return new IXR_Error( 401, __( 'You are not allowed to edit posts on this site.' ) );
    44744474
    44754475                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    44764476                do_action( 'xmlrpc_call', 'blogger.getRecentPosts' );
     
    45134513         * @return IXR_Error
    45144514         */
    45154515        public function blogger_getTemplate($args) {
    4516                 return new IXR_Error( 403, __('Sorry, that file cannot be edited.' ) );
     4516                return new IXR_Error( 403, __('That file cannot be edited.' ) );
    45174517        }
    45184518
    45194519        /**
     
    45244524         * @return IXR_Error
    45254525         */
    45264526        public function blogger_setTemplate($args) {
    4527                 return new IXR_Error( 403, __('Sorry, that file cannot be edited.' ) );
     4527                return new IXR_Error( 403, __('That file cannot be edited.' ) );
    45284528        }
    45294529
    45304530        /**
     
    45604560
    45614561                $cap = ($publish) ? 'publish_posts' : 'edit_posts';
    45624562                if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || !current_user_can($cap) )
    4563                         return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.'));
     4563                        return new IXR_Error(401, __('You are not allowed to post on this site.'));
    45644564
    45654565                $post_status = ($publish) ? 'publish' : 'draft';
    45664566
     
    45804580                        return new IXR_Error(500, $post_ID->get_error_message());
    45814581
    45824582                if ( !$post_ID )
    4583                         return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.'));
     4583                        return new IXR_Error(500, __('Your entry could not be posted. Something wrong happened.'));
    45844584
    45854585                $this->attach_uploads( $post_ID, $post_content );
    45864586
     
    46404640                $this->escape($actual_post);
    46414641
    46424642                if ( ! current_user_can( 'edit_post', $post_ID ) ) {
    4643                         return new IXR_Error(401, __('Sorry, you do not have the right to edit this post.'));
     4643                        return new IXR_Error(401, __('You are not allowed to edit this post.'));
    46444644                }
    46454645                if ( 'publish' == $actual_post['post_status'] && ! current_user_can( 'publish_posts' ) ) {
    4646                         return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
     4646                        return new IXR_Error( 401, __( 'You are not allowed to publish this post.' ) );
    46474647                }
    46484648
    46494649                $postdata = array();
     
    47104710                }
    47114711
    47124712                if ( ! current_user_can( 'delete_post', $post_ID ) ) {
    4713                         return new IXR_Error( 401, __( 'Sorry, you do not have the right to delete this post.' ) );
     4713                        return new IXR_Error( 401, __( 'You are not allowed to delete this post.' ) );
    47144714                }
    47154715
    47164716                $result = wp_delete_post( $post_ID );
     
    47974797                                        $cap  = 'publish_pages';
    47984798                                else
    47994799                                        $cap = 'edit_pages';
    4800                                 $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
     4800                                $error_message = __( 'You are not allowed to publish pages on this site.' );
    48014801                                $post_type = 'page';
    48024802                                if ( !empty( $content_struct['wp_page_template'] ) )
    48034803                                        $page_template = $content_struct['wp_page_template'];
     
    48084808                                        $cap  = 'publish_posts';
    48094809                                else
    48104810                                        $cap = 'edit_posts';
    4811                                 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
     4811                                $error_message = __( 'You are not allowed to publish posts on this site.' );
    48124812                                $post_type = 'post';
    48134813                        } else {
    48144814                                // No other post_type values are allowed here
     
    48214821                                $cap  = 'publish_posts';
    48224822                        else
    48234823                                $cap = 'edit_posts';
    4824                         $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
     4824                        $error_message = __( 'You are not allowed to publish posts on this site.' );
    48254825                        $post_type = 'post';
    48264826                }
    48274827
    48284828                if ( ! current_user_can( get_post_type_object( $post_type )->cap->create_posts ) )
    4829                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts on this site.' ) );
     4829                        return new IXR_Error( 401, __( 'You are not allowed to publish posts on this site.' ) );
    48304830                if ( !current_user_can( $cap ) )
    48314831                        return new IXR_Error( 401, $error_message );
    48324832
     
    50395039                        return new IXR_Error(500, $post_ID->get_error_message());
    50405040
    50415041                if ( !$post_ID )
    5042                         return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.'));
     5042                        return new IXR_Error(500, __('Your entry could not be posted. Something wrong happened.'));
    50435043
    50445044                /**
    50455045                 * Fires after a new post has been successfully created via the XML-RPC MovableType API.
     
    51405140                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    51415141
    51425142                if ( ! current_user_can( 'edit_post', $post_ID ) )
    5143                         return new IXR_Error( 401, __( 'Sorry, you do not have the right to edit this post.' ) );
     5143                        return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    51445144
    51455145                // Use wp.editPost to edit post types other than post and page.
    51465146                if ( ! in_array( $postdata[ 'post_type' ], array( 'post', 'page' ) ) )
     
    53115311
    53125312                if ( 'publish' == $post_status || 'private' == $post_status ) {
    53135313                        if ( 'page' == $post_type && ! current_user_can( 'publish_pages' ) ) {
    5314                                 return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) );
     5314                                return new IXR_Error( 401, __( 'You are not allowed to publish this page.' ) );
    53155315                        } elseif ( ! current_user_can( 'publish_posts' ) ) {
    5316                                 return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
     5316                                return new IXR_Error( 401, __( 'You are not allowed to publish this post.' ) );
    53175317                        }
    53185318                }
    53195319
     
    53505350                        return new IXR_Error(500, $result->get_error_message());
    53515351
    53525352                if ( !$result )
    5353                         return new IXR_Error(500, __('Sorry, your entry could not be edited. Something wrong happened.'));
     5353                        return new IXR_Error(500, __('Your entry could not be edited. Something wrong happened.'));
    53545354
    53555355                // Only posts can be sticky
    53565356                if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) {
     
    54315431                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    54325432
    54335433                if ( !current_user_can( 'edit_post', $post_ID ) )
    5434                         return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     5434                        return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    54355435
    54365436                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    54375437                do_action( 'xmlrpc_call', 'metaWeblog.getPost' );
     
    55615561                        return $this->error;
    55625562
    55635563                if ( ! current_user_can( 'edit_posts' ) )
    5564                         return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
     5564                        return new IXR_Error( 401, __( 'You are not allowed to edit posts on this site.' ) );
    55655565
    55665566                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    55675567                do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' );
     
    56745674                        return $this->error;
    56755675
    56765676                if ( !current_user_can( 'edit_posts' ) )
    5677                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
     5677                        return new IXR_Error( 401, __( 'You must be able to edit posts on this site in order to view categories.' ) );
    56785678
    56795679                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    56805680                do_action( 'xmlrpc_call', 'metaWeblog.getCategories' );
     
    57385738                do_action( 'xmlrpc_call', 'metaWeblog.newMediaObject' );
    57395739
    57405740                if ( !current_user_can('upload_files') ) {
    5741                         $this->error = new IXR_Error( 401, __( 'You do not have permission to upload files.' ) );
     5741                        $this->error = new IXR_Error( 401, __( 'You are not allowed to upload files.' ) );
    57425742                        return $this->error;
    57435743                }
    57445744
    57455745                if ( is_multisite() && upload_is_user_over_quota( false ) ) {
    5746                         $this->error = new IXR_Error( 401, __( 'Sorry, you have used your space allocation.' ) );
     5746                        $this->error = new IXR_Error( 401, __( 'You have used your space allocation.' ) );
    57475747                        return $this->error;
    57485748                }
    57495749
     
    57725772                        $post_id = (int) $data['post_id'];
    57735773
    57745774                        if ( ! current_user_can( 'edit_post', $post_id ) )
    5775                                 return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
     5775                                return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    57765776                }
    57775777                $attachment = array(
    57785778                        'post_title' => $name,
     
    58955895                        return $this->error;
    58965896
    58975897                if ( !current_user_can( 'edit_posts' ) )
    5898                         return new IXR_Error( 401, __( 'Sorry, you must be able to edit posts on this site in order to view categories.' ) );
     5898                        return new IXR_Error( 401, __( 'You must be able to edit posts on this site in order to view categories.' ) );
    58995899
    59005900                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    59015901                do_action( 'xmlrpc_call', 'mt.getCategoryList' );
     
    59435943                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    59445944
    59455945                if ( !current_user_can( 'edit_post', $post_ID ) )
    5946                         return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) );
     5946                        return new IXR_Error( 401, __( 'You are not allowed to edit this post.' ) );
    59475947
    59485948                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
    59495949                do_action( 'xmlrpc_call', 'mt.getPostCategories' );
     
    59975997                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    59985998
    59995999                if ( !current_user_can('edit_post', $post_ID) )
    6000                         return new IXR_Error(401, __('Sorry, you cannot edit this post.'));
     6000                        return new IXR_Error(401, __('You are not allowed to edit this post.'));
    60016001
    60026002                $catids = array();
    60036003                foreach ( $categories as $cat ) {
     
    61166116                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
    61176117
    61186118                if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) )
    6119                         return new IXR_Error(401, __('Sorry, you cannot publish this post.'));
     6119                        return new IXR_Error(401, __('You are not allowed to publish this post.'));
    61206120
    61216121                $postdata['post_status'] = 'publish';
    61226122