Add support for attach BBCode with type / width / alt text (XF 2)
authorTim Düsterhus <tim@bastelstu.be>
Thu, 6 Feb 2020 12:15:31 +0000 (13:15 +0100)
committerTim Düsterhus <tim@bastelstu.be>
Thu, 5 Mar 2020 16:40:33 +0000 (17:40 +0100)
files/lib/system/exporter/XF2xExporter.class.php

index 3164cc03122e26cc6a7713aec965f01fd9f13150..a4a241607418d2d489ae019c28a1798b35e9f1c3 100644 (file)
@@ -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;