diff options
author | Marc Alexander <admin@m-a-styles.de> | 2018-01-24 23:35:49 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2018-01-24 23:35:49 +0100 |
commit | a74658091b19a8d8100b241ce6ac710e472918e8 (patch) | |
tree | ecb7f5e9d2ef10bc2a5074cf404a67590631b0ef /phpBB/phpbb/db/migration | |
parent | 3a8305e19066fe03083104a0825300202cbd1ada (diff) | |
parent | 532afbf83a509b25c5042f5bb374657417ca3e5d (diff) | |
download | forums-a74658091b19a8d8100b241ce6ac710e472918e8.tar forums-a74658091b19a8d8100b241ce6ac710e472918e8.tar.gz forums-a74658091b19a8d8100b241ce6ac710e472918e8.tar.bz2 forums-a74658091b19a8d8100b241ce6ac710e472918e8.tar.xz forums-a74658091b19a8d8100b241ce6ac710e472918e8.zip |
Merge pull request #5102 from JoshyPHP/ticket/15527
[ticket/15527] Skip malformed BBCodes during merge_duplicate_bbcodes migration
Diffstat (limited to 'phpBB/phpbb/db/migration')
-rw-r--r-- | phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index b1ee241f44..71ee19e3dd 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -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'], |