From a2067b2a5f23c592984708ca00a3dcf56c4dab39 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 11 Jun 2020 14:27:03 -0400 Subject: [PATCH] Compare link on Editor screen linked to Edit Posts screen The corrected link behavior routes to the Compare Revisions screen. --- admin/history_rvy.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/history_rvy.php b/admin/history_rvy.php index d2a2c692..b85ee349 100644 --- a/admin/history_rvy.php +++ b/admin/history_rvy.php @@ -41,13 +41,13 @@ public function actLoadRevision() { //wp_reset_vars( array( 'revision', 'action', 'from', 'to' ) ); - $revision_id = (isset($_REQUEST['revision'])) ? (int) $_REQUEST['revision'] : ''; + if (!empty($_REQUEST['revision']) && is_scalar($_REQUEST['revision']) && !empty($_REQUEST['post_id']) && !is_numeric($_REQUEST['revision']) && rvy_is_revision_status(sanitize_key($_REQUEST['revision']))) { + $revision_status = sanitize_key($_REQUEST['revision']); - if (is_scalar($revision_id) && !empty($_REQUEST['post_id']) && rvy_is_revision_status($revision_id)) { - $orderby = ('future-revision' == $revision_id) ? 'post_date' : 'ID'; - $order = ('future-revision' == $revision_id) ? 'DESC' : 'ASC'; + $orderby = ('future-revision' == $revision_status) ? 'post_date' : 'ID'; + $order = ('future-revision' == $revision_status) ? 'DESC' : 'ASC'; - $_revisions = rvy_get_post_revisions(intval($_REQUEST['post_id']), $revision_id, ['orderby' => $orderby, 'order' => $order]); + $_revisions = rvy_get_post_revisions(intval($_REQUEST['post_id']), $revision_status, ['orderby' => $orderby, 'order' => $order]); $revision_id = ($revision = array_pop($_revisions)) ? $revision->ID : 0; $_REQUEST['revision'] = $revision_id;