diff options
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r-- | inc/fulltext.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/inc/fulltext.php b/inc/fulltext.php index eab8850dc..7ee386063 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -394,10 +394,17 @@ function ft_snippet_re_preprocess($term) { return $term; } - // unicode word boundaries - // see http://stackoverflow.com/a/2449017/172068 - $BL = '(?<!\pL)'; - $BR = '(?!\pL)'; + if (UTF8_PROPERTYSUPPORT) { + // unicode word boundaries + // see http://stackoverflow.com/a/2449017/172068 + $BL = '(?<!\pL)'; + $BR = '(?!\pL)'; + } else { + // not as correct as above, but at least won't break + $BL = '\b'; + $BR = '\b'; + } + if(substr($term,0,2) == '\\*'){ $term = substr($term,2); |