From: Sergey Kartashoff Date: Sun, 4 Nov 2001 08:46:55 +0000 (+0000) Subject: - mnoGoSearch extension example updated to support words hilighting (gluke) X-Git-Tag: ChangeLog~425 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e475621f2c1b6e213fcf6ee554ab1a8156254808;p=php - mnoGoSearch extension example updated to support words hilighting (gluke) --- 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;