aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/functions_content.php2
-rw-r--r--tests/text_processing/decode_message_test.php8
3 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 49fd732bb8..d109fe0648 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2749,7 +2749,7 @@ function get_preg_expression($mode)
return array(
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&amp;|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
- '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
+ '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">(.*?)</a><!\-\- \1 \-\->#',
'#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
'#<!\-\- .*? \-\->#s',
'#<.*?>#s',
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 5cebc54eb2..fd39c61b14 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -420,7 +420,7 @@ function decode_message(&$message, $bbcode_uid = '')
$message = str_replace($match, $replace, $message);
$match = get_preg_expression('bbcode_htm');
- $replace = array('\1', '\1', '\2', '\1', '', '');
+ $replace = array('\1', '\1', '\3', '\1', '', '');
$message = preg_replace($match, $replace, $message);
}
diff --git a/tests/text_processing/decode_message_test.php b/tests/text_processing/decode_message_test.php
index c9c1da52d5..7de599f2b1 100644
--- a/tests/text_processing/decode_message_test.php
+++ b/tests/text_processing/decode_message_test.php
@@ -38,6 +38,14 @@ class phpbb_text_processing_decode_message_test extends phpbb_test_case
'<!-- s:) --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /><!-- s:) -->',
':)'
),
+ array(
+ '<!-- w --><a class="postlink" href="http://www.phpbb.com">www.phpbb.com</a><!-- w -->',
+ 'www.phpbb.com'
+ ),
+ array(
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com">http://www.phpbb.com</a><!-- m -->',
+ 'http://www.phpbb.com'
+ ),
/**
* Fails as per PHPBB3-8420
* @link http://tracker.phpbb.com/browse/PHPBB3-8420