mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/14527] Decode automatically generated postlink without prefix
The http prefix gets automatically added and should be removed prior to outputting the post to the user. PHPBB3-14527
This commit is contained in:
parent
dad531e4b2
commit
17b8e93a53
3 changed files with 3 additions and 2 deletions
|
@ -2745,6 +2745,7 @@ function get_preg_expression($mode)
|
||||||
return array(
|
return array(
|
||||||
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
|
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
|
||||||
'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
|
'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
|
||||||
|
'#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="http://(.*?)">\2</a><!\-\- \1 \-\->#',
|
||||||
'#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
|
'#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
|
||||||
'#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
|
'#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
|
||||||
'#<!\-\- .*? \-\->#s',
|
'#<!\-\- .*? \-\->#s',
|
||||||
|
|
|
@ -469,7 +469,7 @@ function decode_message(&$message, $bbcode_uid = '')
|
||||||
$message = str_replace($match, $replace, $message);
|
$message = str_replace($match, $replace, $message);
|
||||||
|
|
||||||
$match = get_preg_expression('bbcode_htm');
|
$match = get_preg_expression('bbcode_htm');
|
||||||
$replace = array('\1', '\1', '\2', '\1', '', '');
|
$replace = array('\1', '\1', '\2', '\2', '\1', '', '');
|
||||||
|
|
||||||
$message = preg_replace($match, $replace, $message);
|
$message = preg_replace($match, $replace, $message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class phpbb_text_processing_decode_message_test extends phpbb_test_case
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'<!-- w --><a class="postlink" href="http://www.phpbb.com">www.phpbb.com</a><!-- w -->',
|
'<!-- w --><a class="postlink" href="http://www.phpbb.com">www.phpbb.com</a><!-- w -->',
|
||||||
'http://www.phpbb.com'
|
'www.phpbb.com'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'<!-- m --><a class="postlink" href="http://www.phpbb.com">http://www.phpbb.com</a><!-- m -->',
|
'<!-- m --><a class="postlink" href="http://www.phpbb.com">http://www.phpbb.com</a><!-- m -->',
|
||||||
|
|
Loading…
Add table
Reference in a new issue