mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
Slight performance optimisation for r9624 refs #54265
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10470 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f90bab90c7
commit
6b519c8bdf
1 changed files with 3 additions and 1 deletions
|
@ -82,9 +82,11 @@ class cache extends acm
|
|||
$result = $db->sql_query($sql);
|
||||
|
||||
$censors = array();
|
||||
$unicode = ((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) ? true : false;
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
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)
|
||||
if ($unicode)
|
||||
{
|
||||
$censors['match'][] = '#(?<![\p{Nd}\p{L}_])(' . str_replace('\*', '[\p{Nd}\p{L}_]*?', preg_quote($row['word'], '#')) . ')(?![\p{Nd}\p{L}_])#iu';
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue