Make attachment BBCode regex for phpBB less specific
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 21 Sep 2020 10:06:18 +0000 (12:06 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 21 Sep 2020 10:07:43 +0000 (12:07 +0200)
Apparently phpBB 3.2 no longer uses the HTML comments within the BBCode tags:

   [attachment=1]IMG_*redacted*.jpg[/attachment]
   [attachment=0]*redacted*_*redacted*.jpg[/attachment]

files/lib/system/exporter/PhpBB31xExporter.class.php

index dfb9fd1bc89201ff8a41ccc380464912f1a26cf1..bdc17b7518a10ec6fdc6ce860987752c086b64d4 100644 (file)
@@ -1550,7 +1550,7 @@ class PhpBB31xExporter extends AbstractExporter {
                }, $text);
                
                // convert attachments
-               $text = preg_replace('~\[attachment=(\d+)\]<!-- ia\\1 -->.*?<!-- ia\\1 -->\[/attachment\]~', '', $text); // TODO: not supported right now
+               $text = preg_replace('~\[attachment=(\d+)\].*?\[/attachment\]~', '', $text); // TODO: not supported right now
                
                // remove crap
                $text = MessageUtil::stripCrap($text);