diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index c4e799a0d5..5b26b0790a 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -51,30 +51,34 @@ function bbencode_second_pass($text, $uid)
// [list] and [list=x] for (un)ordered lists.
// unordered lists
- $text = str_replace("[list:$uid]", '
', $text);
+ $text = str_replace("[list:$uid]", '', $text);
// li tags
- $text = str_replace("[*:$uid]", '- ', $text);
+ $text = str_replace("[*:$uid]", '
- ', $text);
// ending tags
- $text = str_replace("[/list:u:$uid]", '
', $text);
- $text = str_replace("[/list:o:$uid]", '', $text);
+ $text = str_replace("[/list:u:$uid]", '
', $text);
+ $text = str_replace("[/list:o:$uid]", '', $text);
// Ordered lists
- $text = preg_replace("/\[list=([a1]):$uid\]/si", '', $text);
+ $text = preg_replace("/\[list=([a1]):$uid\]/si", '', $text);
// [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.
$text = str_replace("[quote:$uid]", '' . $lang['Quote'] . ' |
', $text);
$text = str_replace("[/quote:$uid]", ' |
|
', $text);
// [b] and [/b] for bolding text.
- $text = str_replace("[b:$uid]", '', $text);
- $text = str_replace("[/b:$uid]", '', $text);
+ $text = str_replace("[b:$uid]", '', $text);
+ $text = str_replace("[/b:$uid]", '', $text);
+
+ // [u] and [/u] for underlining text.
+ $text = str_replace("[u:$uid]", '', $text);
+ $text = str_replace("[/u:$uid]", '', $text);
// [i] and [/i] for italicizing text.
- $text = str_replace("[i:$uid]", '', $text);
- $text = str_replace("[/i:$uid]", '', $text);
+ $text = str_replace("[i:$uid]", '', $text);
+ $text = str_replace("[/i:$uid]", '', $text);
// [img]image_url_here[/img] code..
- $text = str_replace("[img:$uid]", '
', $text);
+ $text = str_replace("[img:$uid]", '
', $text);
// Patterns and replacements for URL and email tags..
$patterns = array();
@@ -82,11 +86,11 @@ function bbencode_second_pass($text, $uid)
// [url]xxxx://www.phpbb.com[/url] code..
$patterns[0] = "#\[url\]([a-z]+?://){1}(.*?)\[/url\]#si";
- $replacements[0] = '\1\2';
+ $replacements[0] = '\1\2';
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[1] = "#\[url\](.*?)\[/url\]#si";
- $replacements[1] = '\1';
+ $replacements[1] = '\1';
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
$patterns[2] = "#\[url=([a-z]+?://){1}(.*?)\](.*?)\[/url\]#si";
@@ -94,11 +98,11 @@ function bbencode_second_pass($text, $uid)
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[3] = "#\[url=(.*?)\](.*?)\[/url\]#si";
- $replacements[3] = '\2';
+ $replacements[3] = '\2';
// [email]user@domain.tld[/email] code..
$patterns[4] = "#\[email\](.*?)\[/email\]#si";
- $replacements[4] = '\1';
+ $replacements[4] = '\1';
$text = preg_replace($patterns, $replacements, $text);
@@ -146,6 +150,9 @@ function bbencode_first_pass($text, $uid)
// [b] and [/b] for bolding text.
$text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text);
+ // [u] and [/u] for underlining text.
+ $text = preg_replace("#\[u\](.*?)\[/u\]#si", "[u:$uid]\\1[/u:$uid]", $text);
+
// [i] and [/i] for italicizing text.
$text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);