diff --git a/phpBB/posting.php b/phpBB/posting.php
index 97a926ca12..ac35af5b93 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -1950,7 +1950,7 @@ else
$user_sig = $userdata['user_sig'];
}
- $post_message = preg_replace("/\:$post_bbcode_uid(|\:[a-z])/si", "", $post_message);
+ $post_message = preg_replace("/(|\:1)\:$post_bbcode_uid(|\:[a-z])/si", "", $post_message);
$post_message = str_replace("
", "\n", $post_message);
$post_message = preg_replace($html_entities_match, $html_entities_replace, $post_message);
$post_message = preg_replace('##si', '</textarea>', $post_message);
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php
index 2e861d9e1d..f77f0abd7c 100644
--- a/phpBB/privmsg.php
+++ b/phpBB/privmsg.php
@@ -1178,7 +1178,7 @@ else if( $submit || $refresh || $mode != "" )
$to_username = $privmsg['username'];
$to_userid = $privmsg['user_id'];
- $privmsg_message = preg_replace("/\:$post_bbcode_uid(|\:[a-z])/si", "", $privmsg_message);
+ $privmsg_message = preg_replace("/(|\:1)\:$post_bbcode_uid(|\:[a-z])/si", "", $privmsg_message);
$privmsg_message = str_replace("
", "\n", $privmsg_message);
$privmsg_message = preg_replace($html_entities_match, $html_entities_replace, $privmsg_message);
$privmsg_message = preg_replace('##si', '</textarea>', $privmsg_message);