summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2014-02-15 14:55:51 +0100
committerMichael Hamann <michael@content-space.de>2014-02-15 15:51:01 +0100
commitef3e3cddddc43156f53958411f3396c9ef5dec60 (patch)
treef13df693ea6c428dda74e47d05f96b783e7a77b5
parent04032c735ec3e60ef6a82418ad3b35560e41c194 (diff)
downloadrpg-ef3e3cddddc43156f53958411f3396c9ef5dec60.tar.gz
rpg-ef3e3cddddc43156f53958411f3396c9ef5dec60.tar.bz2
Only use the whole text as search snippet when it's the first match
-rw-r--r--inc/fulltext.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php
index bd8e6b866..fdaa1a19b 100644
--- a/inc/fulltext.php
+++ b/inc/fulltext.php
@@ -333,7 +333,7 @@ function ft_snippet($id,$highlight){
$pre = min($pre,100-$post);
} else if ($post>50) {
$post = min($post, 100-$pre);
- } else {
+ } else if ($offset == 0) {
// both are less than 50, means the context is the whole string
// make it so and break out of this loop - there is no need for the
// complex snippet calculations