WordPress.org

Make WordPress Core

Ticket #43119: 43119.diff

File 43119.diff, 424 bytes (added by AugusGils, 4 years ago)

Made a check on $post_id to make sure it's a valid one, this to make sure the correct upload folder is used.

  • media.php

     
    419419        $overrides = array( 'test_form' => false );
    420420
    421421        $time = current_time( 'mysql' );
    422         if ( $post = get_post( $post_id ) ) {
     422        if ( $post_id && $post = get_post( $post_id ) ) {
    423423                if ( substr( $post->post_date, 0, 4 ) > 0 ) {
    424424                        $time = $post->post_date;
    425425                }