WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/27/2013 08:21:38 PM (8 years ago)
Author:
markjaquith
Message:

Fix a longstanding "off by one" revision authorship bug.

  • Fixes old revision data on the fly when you open a post for editing.
  • Uses post_name of revisions to store a post version number (-v1), so we know what has been fixed.
  • Latest version should also have a revision stored, whereas before it did not.

props adamsilverstein, mdawaffe. fixes #16215.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r23693 r23823  
    136136    $p = $post_id;
    137137
     138
    138139    if ( empty($post->ID) )
    139140        wp_die( __('You attempted to edit an item that doesn’t exist. Perhaps it was deleted?') );
     
    153154        exit();
    154155    }
     156
     157    //upgrade any old bad revision data (#16215)
     158    _wp_upgrade_revisions_of_post( $p );
    155159
    156160    $post_type = $post->post_type;
Note: See TracChangeset for help on using the changeset viewer.