aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/cache.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-08-21 23:35:43 +0200
committerNils Adermann <naderman@naderman.de>2010-08-21 23:35:43 +0200
commit2e787fa836dbfdcec7864b5f143520aec3752bd0 (patch)
tree9d5d9f166d555168d0117163d304041fbcc9f2af /phpBB/includes/cache.php
parent999f6dbc0c8d48a03756d988487341ad1cc15ee6 (diff)
parent9731f2492f329a35b80483fa7573763b728c4f40 (diff)
downloadforums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar
forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar.gz
forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar.bz2
forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.tar.xz
forums-2e787fa836dbfdcec7864b5f143520aec3752bd0.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: (57 commits) Revert "[ticket/7716] Data too long for column 'message_subject'" [ticket/7716] Data too long for column 'message_subject' [ticket/9780] Adding unit tests for gen_rand_string(). [ticket/9780] Add length check back to gen_rand_string(). [ticket/7972] Copying topics in the MCP now indexes the new topic. [ticket/9782] Board disable radio set on when server load high [ticket/9635] Useless parameter $data['post_time'] in function submit_post. [ticket/9104] Safari does not display box headers correctly in the ACP. [ticket/9777] Print error message in pre-commit hook when php is not installed. [ticket/7716] Data too long for column 'message_subject' [task/git-tools] Ignore git commit message comments [task/git-tools] Adjust the hook to enforce that a ticket is always mentioned [task/git-tools] Vastly expanded commit-msg hook. [task/git-tools] Beginnings of a syntax checking hook. [task/git-tools] Append ticket identifier to commit message prior to editing. [ticket/7332] Redirect users back to post details when performing actions. [ticket/7332] Collapse post details content down to a maximum of 300px heigh [ticket/9771] Remove query string parameters that have no name. [ticket/9760] Remove unrestricted wildcards from search terms. [ticket/9599] Reimplement phpbb_checkdnsrr() function. ... Conflicts: tests/template/template.php
Diffstat (limited to 'phpBB/includes/cache.php')
-rw-r--r--phpBB/includes/cache.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php
index 6b1e078ca4..b50fab4ca2 100644
--- a/phpBB/includes/cache.php
+++ b/phpBB/includes/cache.php
@@ -88,7 +88,14 @@ class cache extends acm
{
if ($unicode)
{
- $censors['match'][] = '#(?<![\p{Nd}\p{L}_])(' . str_replace('\*', '[\p{Nd}\p{L}_]*?', preg_quote($row['word'], '#')) . ')(?![\p{Nd}\p{L}_])#iu';
+ // Unescape the asterisk to simplify further conversions
+ $row['word'] = str_replace('\*', '*', preg_quote($row['word'], '#'));
+
+ // Replace the asterisk inside the pattern, at the start and at the end of it with regexes
+ $row['word'] = preg_replace(array('#(?<=[\p{Nd}\p{L}_])\*(?=[\p{Nd}\p{L}_])#iu', '#^\*#', '#\*$#'), array('([\x20]*?|[\p{Nd}\p{L}_-]*?)', '[\p{Nd}\p{L}_-]*?', '[\p{Nd}\p{L}_-]*?'), $row['word']);
+
+ // Generate the final substitution
+ $censors['match'][] = '#(?<![\p{Nd}\p{L}_-])(' . $row['word'] . ')(?![\p{Nd}\p{L}_-])#iu';
}
else
{