From 952ab260ab7f87aa89066ccc658bfc94ba7f673a Mon Sep 17 00:00:00 2001
From: Michael Hamann <michael@content-space.de>
Date: Mon, 2 May 2011 15:24:47 +0200
Subject: [PATCH] Fix a warning in the indexer when words exist without
 corresponding index FS#2242

---
 inc/indexer.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/inc/indexer.php b/inc/indexer.php
index 714feb4f7..d2a38e4a7 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -489,6 +489,9 @@ class Doku_Indexer {
         foreach ($result as $word => $res) {
             $final[$word] = array();
             foreach ($res as $wid) {
+                // handle the case when ($ixid < count($index)) has been false
+                // and thus $docs[$wid] hasn't been set.
+                if (!isset($docs[$wid])) continue;
                 $hits = &$docs[$wid];
                 foreach ($hits as $hitkey => $hitcnt) {
                     // make sure the document still exists
-- 
GitLab