Fix pass by reference issue. see #24873.

git-svn-id: http://core.svn.wordpress.org/trunk@24866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-29 17:53:24 +00:00
parent b53325cad3
commit e0c4fc0032

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 );