Merge similar error strings for invalid data.

props pavelevap.
fixes #32329.
Built from https://develop.svn.wordpress.org/trunk@32477


git-svn-id: http://core.svn.wordpress.org/trunk@32447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-05-09 21:09:25 +00:00
parent 42cd948544
commit 60c9fdf9fd
4 changed files with 8 additions and 8 deletions

View File

@ -2244,7 +2244,7 @@ class wp_xmlrpc_server extends IXR_Server {
$user_data = get_userdata( $user_id );
if ( ! $user_data )
return new IXR_Error( 404, __( 'Invalid user ID' ) );
return new IXR_Error( 404, __( 'Invalid user ID.' ) );
return $this->_prepare_user( $user_data, $fields );
}
@ -3817,7 +3817,7 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.getRevisions' );
if ( ! $post = get_post( $post_id ) )
return new IXR_Error( 404, __( 'Invalid post ID' ) );
return new IXR_Error( 404, __( 'Invalid post ID.' ) );
if ( ! current_user_can( 'edit_post', $post_id ) )
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
@ -3878,13 +3878,13 @@ class wp_xmlrpc_server extends IXR_Server {
do_action( 'xmlrpc_call', 'wp.restoreRevision' );
if ( ! $revision = wp_get_post_revision( $revision_id ) )
return new IXR_Error( 404, __( 'Invalid post ID' ) );
return new IXR_Error( 404, __( 'Invalid post ID.' ) );
if ( wp_is_post_autosave( $revision ) )
return new IXR_Error( 404, __( 'Invalid post ID' ) );
return new IXR_Error( 404, __( 'Invalid post ID.' ) );
if ( ! $post = get_post( $revision->post_parent ) )
return new IXR_Error( 404, __( 'Invalid post ID' ) );
return new IXR_Error( 404, __( 'Invalid post ID.' ) );
if ( ! current_user_can( 'edit_post', $revision->post_parent ) )
return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );

View File

@ -65,7 +65,7 @@ function set_post_format( $post, $format ) {
$post = get_post( $post );
if ( empty( $post ) )
return new WP_Error( 'invalid_post', __( 'Invalid post' ) );
return new WP_Error( 'invalid_post', __( 'Invalid post.' ) );
if ( ! empty( $format ) ) {
$format = sanitize_key( $format );

View File

@ -260,7 +260,7 @@ function _wp_put_post_revision( $post = null, $autosave = false ) {
$post = get_post($post, ARRAY_A);
if ( ! $post || empty($post['ID']) )
return new WP_Error( 'invalid_post', __( 'Invalid post ID' ) );
return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );
if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32476';
$wp_version = '4.3-alpha-32477';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.