From 042ae35eca9d87ff9c41bd5ef511c1a482c9b807 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 31 Oct 2012 09:55:22 +0100 Subject: [PATCH] Fix #985 : Thesaurus bouncing --- lib/classes/caption/record.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/classes/caption/record.class.php b/lib/classes/caption/record.class.php index afa45b9b23..1fb2c41de8 100644 --- a/lib/classes/caption/record.class.php +++ b/lib/classes/caption/record.class.php @@ -271,16 +271,21 @@ class caption_record implements caption_interface, cache_cacheableInterface $ret = $searchEngine->build_excerpt($highlight, $fields, $this->record); if ($ret) { - $n = 0; + $n = -1; foreach ($fields as $key => $value) { - if ( ! isset($fields[$key])) + $n++; + + if (!isset($fields[$key])) { continue; + } + + if (strpos($fields[$key]['value'], '