diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index f82c7b0771..e97b4feb85 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -470,11 +470,17 @@ class factory implements \phpbb\textformatter\cache_interface $tag->attributes->add('text'); $tag->template = ''; + $board_url = generate_board_url() . '/'; $tag->filterChain ->add(array($this->link_helper, 'truncate_local_url')) ->resetParameters() ->addParameterByName('tag') - ->addParameterByValue(generate_board_url() . '/'); + ->addParameterByValue($board_url); + $tag->filterChain + ->add(array($this->link_helper, 'truncate_local_url')) + ->resetParameters() + ->addParameterByName('tag') + ->addParameterByValue(preg_replace('(^\\w+:)', '', $board_url)); $tag->filterChain ->add(array($this->link_helper, 'truncate_text')) ->resetParameters() diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php index ce15a52adc..157af196d9 100644 --- a/tests/text_formatter/s9e/default_formatting_test.php +++ b/tests/text_formatter/s9e/default_formatting_test.php @@ -257,6 +257,10 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case '[url=http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[/url]', 'http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ), + array( + '[url]//localhost/phpbb/viewforum.php?f=1[/url]', + 'viewforum.php?f=1' + ), array( '[quote="[url=http://example.org]xxx[/url]"]...[/quote]', '
xxx wrote:...
'