1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-22 00:21:02 +01:00

Merge branch '3.2.x'

This commit is contained in:
Marc Alexander 2018-01-24 23:35:53 +01:00
commit 2053399085
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
2 changed files with 22 additions and 10 deletions

View File

@ -46,16 +46,25 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat
protected function merge_bbcodes(array $without, array $with)
{
$merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes(
[
'usage' => $without['bbcode_match'],
'template' => $without['bbcode_tpl']
],
[
'usage' => $with['bbcode_match'],
'template' => $with['bbcode_tpl']
]
);
try
{
$merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes(
[
'usage' => $without['bbcode_match'],
'template' => $without['bbcode_tpl']
],
[
'usage' => $with['bbcode_match'],
'template' => $with['bbcode_tpl']
]
);
}
catch (\Exception $e)
{
// Ignore the pair and move on. The BBCodes would have to be fixed manually
return;
}
$bbcode_data = [
'bbcode_tag' => $without['bbcode_tag'],
'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'],

View File

@ -37,6 +37,9 @@ class bbcode_merger
*
* All of the arrays contain a "usage" element and a "template" element
*
* @throws InvalidArgumentException if a definition cannot be interpreted
* @throws RuntimeException if something unexpected occurs
*
* @param array $without BBCode definition without an attribute
* @param array $with BBCode definition with an attribute
* @return array Merged definition