From e475621f2c1b6e213fcf6ee554ab1a8156254808 Mon Sep 17 00:00:00 2001 From: Sergey Kartashoff Date: Sun, 4 Nov 2001 08:46:55 +0000 Subject: [PATCH] - mnoGoSearch extension example updated to support words hilighting (gluke) --- ext/mnogosearch/index.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ext/mnogosearch/index.php b/ext/mnogosearch/index.php index 7d4abf6b1c..4f98ac911e 100644 --- a/ext/mnogosearch/index.php +++ b/ext/mnogosearch/index.php @@ -194,10 +194,16 @@ function ParseDocText($text){ global $hlbeg, $hlend; $str=$text; - for ($i=0; $i\?\/\,\.]+)($word)/i","\\1$hlbeg\\2$hlend",$str); - $str = preg_replace("/^($word)/i","$hlbeg\\1$hlend",$str); + + if (Udm_Api_Version() < 30200) { + for ($i=0; $i\?\/\,\.]+)($word)/i","\\1$hlbeg\\2$hlend",$str); + $str = preg_replace("/^($word)/i","$hlbeg\\1$hlend",$str); + } + } else { + $str = str_replace("\2",$hlbeg,$str); + $str = str_replace("\3",$hlend,$str); } return $str; -- 2.50.1