diff options
Diffstat (limited to 'phpBB/includes/cache.php')
-rw-r--r-- | phpBB/includes/cache.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index fc9a01ae4e..392f1377da 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -84,7 +84,15 @@ class cache extends acm $censors = array(); while ($row = $db->sql_fetchrow($result)) { - $censors['match'][] = '#(?<!\w)(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')(?!\w)#i'; + if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false) + { + $censors['match'][] = '#(?<!\p{L})(' . str_replace('\*', '\p{L}*?', preg_quote($row['word'], '#')) . ')(?!\p{L})#u'; + } + else + { + $censors['match'][] = '#(?<!\S)(' . str_replace('\*', '\S*?', preg_quote($row['word'], '#')) . ')(?!\S)#iu'; + } + $censors['replace'][] = $row['replacement']; } $db->sql_freeresult($result); |