mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Merge pull request #3747 from rxu/ticket/13377
[ticket/13377] Fix decoding for www type URLs in function decode_message()
This commit is contained in:
commit
58d1d37c16
3 changed files with 10 additions and 2 deletions
|
@ -2749,7 +2749,7 @@ function get_preg_expression($mode)
|
|||
return array(
|
||||
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
|
||||
'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&|\?)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',
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue