diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-11-12 21:22:26 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-11-12 21:22:26 +0100 |
commit | 3161005d07beb46bb8a866ec56a768938571ec9d (patch) | |
tree | eef6ac12c9aa09de859eba984ddc7990c82a198a /inc/fulltext.php | |
parent | a21383af58203bf0e6dc36a07ea78fae0b58c1ef (diff) | |
download | rpg-3161005d07beb46bb8a866ec56a768938571ec9d.tar.gz rpg-3161005d07beb46bb8a866ec56a768938571ec9d.tar.bz2 |
check for unicode preg capabilities in UTF-8 lib FS#2636
We now have two defines for checking for UTF-8 and Unicode property
support in PREG and use them to work around FS#2636 on older systems.
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); |