Merge branch '3.3.x'

This commit is contained in:
Marc Alexander 2020-04-16 20:49:27 +02:00
commit e566ff10b4
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
3 changed files with 13 additions and 3 deletions

View file

@ -549,8 +549,8 @@ class acp_board
} }
} }
// Invalidate the text_formatter cache when posting options are changed // Invalidate the text_formatter cache when posting or server options are changed
if ($mode == 'post' && $submit) if (preg_match('(^(?:post|server)$)', $mode) && $submit)
{ {
$phpbb_container->get('text_formatter.cache')->invalidate(); $phpbb_container->get('text_formatter.cache')->invalidate();
} }

View file

@ -470,11 +470,17 @@ class factory implements \phpbb\textformatter\cache_interface
$tag->attributes->add('text'); $tag->attributes->add('text');
$tag->template = '<xsl:value-of select="@text"/>'; $tag->template = '<xsl:value-of select="@text"/>';
$board_url = generate_board_url() . '/';
$tag->filterChain $tag->filterChain
->add(array($this->link_helper, 'truncate_local_url')) ->add(array($this->link_helper, 'truncate_local_url'))
->resetParameters() ->resetParameters()
->addParameterByName('tag') ->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 $tag->filterChain
->add(array($this->link_helper, 'truncate_text')) ->add(array($this->link_helper, 'truncate_text'))
->resetParameters() ->resetParameters()

View file

@ -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]', '[url=http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[/url]',
'<a href="http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" class="postlink">http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</a>' '<a href="http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" class="postlink">http://example.org/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</a>'
), ),
array(
'[url]//localhost/phpbb/viewforum.php?f=1[/url]',
'<a href="//localhost/phpbb/viewforum.php?f=1" class="postlink">viewforum.php?f=1</a>'
),
array( array(
'[quote="[url=http://example.org]xxx[/url]"]...[/quote]', '[quote="[url=http://example.org]xxx[/url]"]...[/quote]',
'<blockquote><div><cite><a href="http://example.org" class="postlink">xxx</a> wrote:</cite>...</div></blockquote>' '<blockquote><div><cite><a href="http://example.org" class="postlink">xxx</a> wrote:</cite>...</div></blockquote>'