summaryrefslogtreecommitdiff
path: root/inc/fulltext.php
diff options
context:
space:
mode:
authorGuy Brand <gb@unistra.fr>2013-03-06 14:08:08 +0100
committerGuy Brand <gb@unistra.fr>2013-03-06 14:08:08 +0100
commit23678e344b4ddcad14254c106ecb93af174fdaa0 (patch)
treea5c787e4d87313a7fb6f18cb4c78bf210d92d60c /inc/fulltext.php
parent847cef0a6bfd2ff9dc54e1fc140f5ba0ece0017a (diff)
parent5721a1547938df76003c6d91ea003dc1c70abd94 (diff)
downloadrpg-23678e344b4ddcad14254c106ecb93af174fdaa0.tar.gz
rpg-23678e344b4ddcad14254c106ecb93af174fdaa0.tar.bz2
Merge branch 'master' into stable
Diffstat (limited to 'inc/fulltext.php')
-rw-r--r--inc/fulltext.php15
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);