From e4f7ec3187c7df7deca61b17177287259f600320 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 22 Jan 2006 20:11:38 +0000 Subject: [PATCH] Fixed fetch_prev_revision() --- includes/cachev.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/cachev.php b/includes/cachev.php index a6a8b5a..04b9593 100644 --- a/includes/cachev.php +++ b/includes/cachev.php @@ -141,14 +141,21 @@ class cacheV $data = $this->fetch_node(); $data = $data['history']; - if (sizeof($data['history']) < 1) + if (sizeof($data) < 1) { return $this->fetch_revision(0); } - unset($data[ max(array_keys($data)) ]); + $list = array_keys($data); + + $key = array_search($revision, $list); + $key++; // go to the next earliest revision + if (!isset($list["$key"])) + { + return -1; + } - return $this->fetch_revision(max(array_keys($data))); + return $this->fetch_revision($list["$key"]); } // ################################################################### -- 2.22.5