From a7f67e0c1ead49c137592bdf54b8821189210595 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 12 Jan 2006 18:17:20 +0000 Subject: [PATCH] Make fetch_prev_rev() work if there is no history --- includes/cachev.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/cachev.php b/includes/cachev.php index 16d9460..2053e28 100644 --- a/includes/cachev.php +++ b/includes/cachev.php @@ -139,6 +139,11 @@ class cacheV $data = $this->fetch_node($node); $data = $data['history']; + if (count($data['history']) < 1) + { + return $this->fetch_revision(0); + } + unset($data[ max(array_keys($data)) ]); return $this->fetch_revision(max(array_keys($data))); -- 2.22.5