shriker / xenforo-to-flarum

PHP migration scripts for XenForo 1.5 to Flarum.

Home Page:https://discuss.flarum.org/d/20882-xenforo-to-flarum-import-migration-scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attributed bbcode [quote] is causing an error

shriker opened this issue · comments

Need to adjust the regex to more thoroughly sanitize data from XenForo [QUOTE] tags.

There's a better way to handle BBCodes:

  1. Obtain a copy of the parser used in Flarum. You can do that manually outside of your migration script.
  2. Serialize the parser and save it as part of your script.
  3. Unserialize and use the parser to parse posts from XenForo.

As a proof-of-concept, you can take XenForo's posts and process them via s9e\TextFormatter\Bundles\Forum::parse($text_goes_here) and it will give you a decent approximation of what Flarum's XML would look like.

I totally agree. The bbcode conversion in here is nearly a 1:1 copy of the forked repo that is pretty quick & dirty. While it works, it's less than ideal.