mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #5102 from JoshyPHP/ticket/15527
[ticket/15527] Skip malformed BBCodes during merge_duplicate_bbcodes migration
This commit is contained in:
commit
a74658091b
2 changed files with 22 additions and 10 deletions
|
@ -45,6 +45,8 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function merge_bbcodes(array $without, array $with)
|
protected function merge_bbcodes(array $without, array $with)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
$merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes(
|
$merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes(
|
||||||
[
|
[
|
||||||
|
@ -56,6 +58,13 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat
|
||||||
'template' => $with['bbcode_tpl']
|
'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_data = [
|
||||||
'bbcode_tag' => $without['bbcode_tag'],
|
'bbcode_tag' => $without['bbcode_tag'],
|
||||||
'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'],
|
'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'],
|
||||||
|
|
|
@ -37,6 +37,9 @@ class bbcode_merger
|
||||||
*
|
*
|
||||||
* All of the arrays contain a "usage" element and a "template" element
|
* 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 $without BBCode definition without an attribute
|
||||||
* @param array $with BBCode definition with an attribute
|
* @param array $with BBCode definition with an attribute
|
||||||
* @return array Merged definition
|
* @return array Merged definition
|
||||||
|
|
Loading…
Add table
Reference in a new issue