Fixed vB4 Import: Use PLAIN BB Code to escape partial BB Code in titles

Steffen

Well-known member
If a post title contains partial BB Code like "[S]" ("S" standing for "Suche" / "Searching" in a marketplace forum) then prepending the post title to the post message causes the whole message to be striked-through because XenForo auto-closes BB Code tags.

One possible solution could be to wrap the post title with the "PLAIN" BB Code:
Diff:
diff --git a/src/addons/XFI/Import/Importer/vBulletin.php b/src/addons/XFI/Import/Importer/vBulletin.php
index 841205868..406f1a3e2 100644
--- a/src/addons/XFI/Import/Importer/vBulletin.php
+++ b/src/addons/XFI/Import/Importer/vBulletin.php
@@ -3918,6 +3918,10 @@ class vBulletin extends AbstractForumImporter
 
                 if ($title !== ($matches[1] . $matches[2] . $threadTitle))
                 {
+                    if (strpos($title, '[') !== false)
+                    {
+                        $title = '[PLAIN]' . $title . '[/PLAIN]';
+                    }
                     $message = "[b]{$title}[/b]\n\n" . ltrim($message);
                 }
             }
 
Top Bottom