MyBB Importer : convertContentToBbCode wrong embedded attachment id

K a M a L

Active member
Affected version
1.5.1
The MyBB importer has a bug that ruined my last migration
at method convertContentToBbCode
there is a call
Code:
$content = preg_replace('#\[attachment=(\d)+]#siU', '[ATTACH=full]$1[/ATTACH]', $content);
this converted [attachment=26549] to [ATTACH=full]9[/ATTACH]
because the capture group captures only the last digit
it should be
Code:
$content = preg_replace('#\[attachment=(\d+)]#siU', '[ATTACH=full]$1[/ATTACH]', $content);
 
Last edited:
Top