From a69a8c87d97dea012992a67e0a0a0f0b6d4ee98b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 6 Feb 2020 13:15:31 +0100 Subject: [PATCH] Add support for attach BBCode with type / width / alt text (XF 2) --- files/lib/system/exporter/XF2xExporter.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/lib/system/exporter/XF2xExporter.class.php b/files/lib/system/exporter/XF2xExporter.class.php index 3164cc0..a4a2416 100644 --- a/files/lib/system/exporter/XF2xExporter.class.php +++ b/files/lib/system/exporter/XF2xExporter.class.php @@ -1723,6 +1723,9 @@ class XF2xExporter extends AbstractExporter { $message = $userRegex->replace($message, $userCallback); $message = $quoteRegex->replace($message, $quoteCallback); + // fix attach bbcodes + $message = preg_replace('/\[attach(?: type="[^"]+")?(?: width="[^"]+")?(?: alt="[^"]+")?\]/i', '[attach]', $message); + // fix color bbcodes $message = preg_replace_callback('/\[color=rgb\((\d+),\s*(\d+),\s*(\d+)\)\]/i', function ($matches) { list(, $r, $g, $b) = $matches; -- 2.20.1