From e62e18d2e319744145923c765a53cd1a4ab8cd78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 25 Sep 2020 09:38:50 +0200 Subject: [PATCH] Convert [table] BBCode (vB 5) --- files/lib/system/exporter/VB5xExporter.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/files/lib/system/exporter/VB5xExporter.class.php b/files/lib/system/exporter/VB5xExporter.class.php index c4c45f0..e1c37db 100644 --- a/files/lib/system/exporter/VB5xExporter.class.php +++ b/files/lib/system/exporter/VB5xExporter.class.php @@ -1125,6 +1125,7 @@ class VB5xExporter extends AbstractExporter { static $img2Callback = null; static $attachRegex = null; static $attachCallback = null; + static $tableRegex = null; if ($quoteRegex === null) { $quoteRegex = new Regex('\[quote=(.*?);n(\d+)\]', Regex::CASE_INSENSITIVE); @@ -1196,6 +1197,8 @@ class VB5xExporter extends AbstractExporter { return ""; } }; + + $tableRegex = new Regex('\[TABLE(?:="[a-z0-9_-]+:\s*[a-z0-9_-]+(?:,\s*[a-z0-9_-]+:\s*[a-z0-9_-]+)*")?\]', Regex::CASE_INSENSITIVE); } // use proper WCF 2 bbcode @@ -1227,6 +1230,9 @@ class VB5xExporter extends AbstractExporter { // attach $message = $attachRegex->replace($message, $attachCallback); + // tables + $message = $tableRegex->replace($message, '[table]'); + // fix size bbcodes $message = preg_replace_callback('/\[size=\'?(\d+)(px)?\'?\]/i', function ($matches) { $unit = 'scalar'; -- 2.20.1