WordPress.org

Make WordPress Core

Ticket #21858: miqro-21858-autosave.patch

File miqro-21858-autosave.patch, 730 bytes (added by miqrogroove, 19 months ago)

Autosave bug located and fixed.

  • wp-admin/includes/post.php

     
    158158                        wp_die( __('You are not allowed to edit this post.' )); 
    159159        } 
    160160 
    161         // Autosave shouldn't save too soon after a real save 
    162         if ( 'autosave' == $post_data['action'] ) { 
    163                 $post = get_post( $post_ID ); 
    164                 $now = time(); 
    165                 $then = strtotime($post->post_date_gmt . ' +0000'); 
    166                 $delta = AUTOSAVE_INTERVAL / 2; 
    167                 if ( ($now - $then) < $delta ) 
    168                         return $post_ID; 
    169         } 
    170  
    171161        $post_data = _wp_translate_postdata( true, $post_data ); 
    172162        if ( is_wp_error($post_data) ) 
    173163                wp_die( $post_data->get_error_message() );