Steffen
Well-known member
- Affected version
- 2.0.2
I think this method is supposed to prepend the post title to the post message unless it's "Re: [thread title]". But the code cannot work because it doesn't know the thread title. At the moment it essentially checks whether
Partial fix:
Unfortunately, I think the thread title is unknown in
$postTitle
matches (Re: )?$postTitle
which is always true.Partial fix:
Diff:
diff --git src/XF/Import/Importer/vBulletin.php src/XF/Import/Importer/vBulletin.php
--- a/htdocs/xenforo/src/XF/Import/Importer/vBulletin.php
+++ b/htdocs/xenforo/src/XF/Import/Importer/vBulletin.php
@@ -3559,11 +3559,11 @@ class vBulletin extends AbstractForumImporter
"), [$threadId, $startDate]);
}
- protected function getPostMessage($title, $message)
+ protected function getPostMessage($title, $message, $threadTitle)
{
if ($title !== '')
{
- $titleRegex = '/^(re:\s*)?' . preg_quote($title, '/') . '$/i';
+ $titleRegex = '/^(re:\s*)?' . preg_quote($threadTitle, '/') . '$/i';
if (!preg_match($titleRegex, $title))
{
Unfortunately, I think the thread title is unknown in
stepPosts
and might have to be fetched from the DB.
Last edited: