diff --git a/inc/html.php b/inc/html.php index 080beb01ad5957d8e04b8204d7c9c541740d85af..fcfa54b6c7f8cd7744453a7875219c1aa1bec69b 100644 --- a/inc/html.php +++ b/inc/html.php @@ -284,7 +284,8 @@ function html_hilight($html,$phrases){ $regex = join('|',array_map('ft_snippet_re_preprocess', array_map('preg_quote_cb',$phrases))); if ($regex === '') return $html; - $html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html); + if (!utf8_check($regex)) return $html; + $html = @preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html); return $html; }