From 2e2fda0810b802a029201f606373c449bff4e7c0 Mon Sep 17 00:00:00 2001
From: Yann <yann.hamon@gmail.com>
Date: Mon, 10 Apr 2006 21:04:09 +0200
Subject: [PATCH] small fix for getRevisionInfo

darcs-hash:20060410190409-919ab-f77447b1cb1b8de6e2a5790519d4aafc7baa577b.gz
---
 inc/common.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/inc/common.php b/inc/common.php
index ca05bd3e7..4d52c0ee6 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -950,9 +950,10 @@ function getRevisionInfo($id,$rev){
   // one line with one same timestamp
   $loglines_matching = array();
   $loglines_matching[] =  $loglines[$index];
-  for ($i=$index-1;hasTimestamp($loglines[$i], $rev) == 0; $i--)
+  for ($i=$index-1;$i>=0 && hasTimestamp($loglines[$i], $rev) == 0; $i--)
     $loglines_matching[] = $loglines[$i];
-  for ($i=$index+1;hasTimestamp($loglines[$i], $rev) == 0; $i++)
+  $logsize = count($loglines);
+  for ($i=$index+1;$i<$logsize && hasTimestamp($loglines[$i], $rev) == 0; $i++)
     $loglines_matching[] = $loglines[$i];
 
   // Match only lines concerning the document $id
-- 
GitLab