Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[ticket/10117] Add one more missed 'u' modifier, add code comment

PHPBB3-10117
  • Loading branch information...
commit b8adad0d48845540083519651bf9befb6cffaceb 1 parent 25ae46b
@rxu rxu authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 phpBB/includes/message_parser.php
View
7 phpBB/includes/message_parser.php
@@ -1332,6 +1332,8 @@ function smilies($max_smilies = 0)
{
if ($max_smilies)
{
+ // '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);
@@ -1343,7 +1345,10 @@ function smilies($max_smilies = 0)
}
// 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('(?![^<>]*>)#u' . 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));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.