WordPress.org

Make WordPress Core

Ticket #32585: post.diff

File post.diff, 735 bytes (added by ericdaams, 6 years ago)

Using isset instead of empty ensures that post_author of 0 is correctly handled.

  • post.php

     
    33133313
    33143314        // These variables are needed by compact() later.
    33153315        $post_content_filtered = $postarr['post_content_filtered'];
    3316         $post_author = empty( $postarr['post_author'] ) ? $user_id : $postarr['post_author'];
     3316        $post_author = isset( $postarr['post_author'] ) ? $postarr['post_author'] : $user_id;
    33173317        $ping_status = empty( $postarr['ping_status'] ) ? get_option( 'default_ping_status' ) : $postarr['ping_status'];
    33183318        $to_ping = isset( $postarr['to_ping'] ) ? sanitize_trackback_urls( $postarr['to_ping'] ) : '';
    33193319        $pinged = isset( $postarr['pinged'] ) ? $postarr['pinged'] : '';