diff options
| author | JoshyPHP <s9e.dev@gmail.com> | 2018-01-22 02:37:47 +0100 |
|---|---|---|
| committer | JoshyPHP <s9e.dev@gmail.com> | 2018-01-22 02:37:47 +0100 |
| commit | 5c8a667db2e47313e687fd8afe3c4fa7c73abeb9 (patch) | |
| tree | 6b9b3e14aa5b211ebcbe3a5d275de99df2aeb203 /phpBB/phpbb/db | |
| parent | d0143bec8830e709047443f73f79c0dce438e3fc (diff) | |
| download | forums-5c8a667db2e47313e687fd8afe3c4fa7c73abeb9.tar forums-5c8a667db2e47313e687fd8afe3c4fa7c73abeb9.tar.gz forums-5c8a667db2e47313e687fd8afe3c4fa7c73abeb9.tar.bz2 forums-5c8a667db2e47313e687fd8afe3c4fa7c73abeb9.tar.xz forums-5c8a667db2e47313e687fd8afe3c4fa7c73abeb9.zip | |
[ticket/15527] Skip malformed BBCodes during merge_duplicate_bbcodes migration
PHPBB3-15527
Diffstat (limited to 'phpBB/phpbb/db')
| -rw-r--r-- | phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 31 |
1 files changed, 21 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 08609b571b..6457a84adb 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -13,6 +13,8 @@ namespace phpbb\db\migration\data\v32x; +use Exception; + class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration { public function update_data() @@ -46,16 +48,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'], |
