WordPress.org

Make WordPress Core

Ticket #22335: 22335.fix-wp-methods.diff

File 22335.fix-wp-methods.diff, 553 bytes (added by markoheijnen, 18 months ago)

Check if post status exists before overwriting it

  • wp-includes/class-wp-xmlrpc-server.php

     
    10341034                                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ) ); 
    10351035                                break; 
    10361036                        default: 
    1037                                 $post_data['post_status'] = 'draft'; 
     1037                                if( ! get_post_status_object( $post_data['post_status'] ) ) 
     1038                                        $post_data['post_status'] = 'draft'; 
    10381039                        break; 
    10391040                } 
    10401041