diff options
author | Chris Smith <toonarmy@phpbb.com> | 2010-02-01 22:14:04 +0000 |
---|---|---|
committer | Chris Smith <toonarmy@phpbb.com> | 2010-02-01 22:14:04 +0000 |
commit | 6b519c8bdfc5338f71967ee6cbdc53262afc3396 (patch) | |
tree | 686312fabab8719c2e0e31575fb2d0385da5a38d /phpBB/includes/cache.php | |
parent | f90bab90c742fbbff89a9b9ae78b7c921a6e139c (diff) | |
download | forums-6b519c8bdfc5338f71967ee6cbdc53262afc3396.tar forums-6b519c8bdfc5338f71967ee6cbdc53262afc3396.tar.gz forums-6b519c8bdfc5338f71967ee6cbdc53262afc3396.tar.bz2 forums-6b519c8bdfc5338f71967ee6cbdc53262afc3396.tar.xz forums-6b519c8bdfc5338f71967ee6cbdc53262afc3396.zip |
Slight performance optimisation for r9624 refs #54265
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10470 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/cache.php')
-rw-r--r-- | phpBB/includes/cache.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index a0142292ed..c760c20d52 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -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'; } |