aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-04-17 00:31:24 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-04-17 00:31:24 -0400
commit76bc4c24a592d83befb9721c3559b3d234478dd1 (patch)
treecf2b4e623c8e5098e9d5f18cdd2158a5db187775
parentd4e938b25bca75a23a6b51df4850646af56f3d00 (diff)
parentb8adad0d48845540083519651bf9befb6cffaceb (diff)
downloadforums-76bc4c24a592d83befb9721c3559b3d234478dd1.tar
forums-76bc4c24a592d83befb9721c3559b3d234478dd1.tar.gz
forums-76bc4c24a592d83befb9721c3559b3d234478dd1.tar.bz2
forums-76bc4c24a592d83befb9721c3559b3d234478dd1.tar.xz
forums-76bc4c24a592d83befb9721c3559b3d234478dd1.zip
Merge branch 'ticket/rxu/10117' into develop-olympus
* ticket/rxu/10117: [ticket/10117] Add one more missed 'u' modifier, add code comment [ticket/10117] Make smilies to be correctly parsed within unicode text.
-rw-r--r--phpBB/includes/message_parser.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 26532e84c0..6951dcf820 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1332,7 +1332,9 @@ class parse_message extends bbcode_firstpass
{
if ($max_smilies)
{
- $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#', $this->message, $matches);
+ // 'u' modifier has been added to correctly parse smilies within unicode strings
+ // For details: http://tracker.phpbb.com/browse/PHPBB3-10117
+ $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#u', $this->message, $matches);
unset($matches);
if ($num_matches !== false && $num_matches > $max_smilies)
@@ -1343,7 +1345,10 @@ class parse_message extends bbcode_firstpass
}
// Make sure the delimiter # is added in front and at the end of every element within $match
- $this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#'), $replace, $this->message));
+ // 'u' modifier has been added to correctly parse smilies within unicode strings
+ // For details: http://tracker.phpbb.com/browse/PHPBB3-10117
+
+ $this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#u' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#u'), $replace, $this->message));
}
}