Fix pass by reference issue. see #24873.

git-svn-id: https://develop.svn.wordpress.org/trunk@24866 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-07-29 17:53:24 +00:00
parent 7c99f40451
commit 19bc573d35

View File

@ -180,10 +180,12 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
$compare_two_mode = is_numeric( $from );
if ( ! $compare_two_mode ) {
$found = array_search( $selected_revision_id, array_keys( $revisions ) );
if ( $found )
$from = array_shift( array_keys( array_slice( $revisions, $found - 1, 1, true ) ) );
else
if ( $found ) {
$from = array_keys( array_slice( $revisions, $found - 1, 1, true ) );
$from = reset( $from );
} else {
$from = 0;
}
}
$from = absint( $from );