Make WordPress Core


Ignore:
Timestamp:
07/29/2013 05:27:48 PM (13 years ago)
Author:
markjaquith
Message:

Revisions: Fix PHP loading of comparison to first revision, and premature rendering of tooltip.

Props aaroncampbell, markjaquith. Fixes #24873 for 3.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.6/wp-admin/includes/revision.php

    r24836 r24865  
    180180        $compare_two_mode = is_numeric( $from );
    181181        if ( ! $compare_two_mode ) {
    182                 $from = array_keys( array_slice( $revisions, array_search( $selected_revision_id, array_keys( $revisions ) ) - 1, 1, true ) );
    183                 $from = $from[0];
     182                $found = array_search( $selected_revision_id, array_keys( $revisions ) );
     183                if ( $found )
     184                        $from = array_shift( array_keys( array_slice( $revisions, $found - 1, 1, true ) ) );
     185                else
     186                        $from = 0;
    184187        }
    185188
Note: See TracChangeset for help on using the changeset viewer.