WordPress.org

Make WordPress Core

Changeset 9675


Ignore:
Timestamp:
11/14/2008 03:26:06 AM (13 years ago)
Author:
azaozz
Message:

Fix uploads sub-directory for drafts, props DD32, fixes #8205

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r9663 r9675  
    174174function media_handle_upload($file_id, $post_id, $post_data = array()) {
    175175    $overrides = array('test_form'=>false);
    176    
    177     $post = get_post($post_id);
    178     $time = $post->post_date_gmt;
     176
     177    $time = current_time('mysql', true);
     178    if ( $post = get_post($post_id) ) {
     179        if ( substr( $post->post_date, 0, 4 ) > 0 )
     180            $time = $post->post_date;
     181    }
    179182
    180183    $file = wp_handle_upload($_FILES[$file_id], $overrides, $time);
Note: See TracChangeset for help on using the changeset viewer.