1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 What's the best way to cleanup broken font tags after migration from vB?

Discussion in 'Troubleshooting and Problems' started by popowich, May 1, 2015.

  1. popowich

    popowich Active Member

    What's the best way to fix this so that the following "Example Text" becomes quoted text instead of plain text surrounded by broken tags?

    [FONT=&quot] Example Text [/FONT]

    I think to start I want to replace [FONT=&quot] with [ q-u-o-t-e-] (without the dashes)

    How to fix the associated [/FONT] without breaking [/font]'s not related to [q-u-o-t-e] concerns me.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If it is simple replacements, you can do it with basic queries:
    UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
    Otherwise for more complex replacements, there's this add-on: https://xenforo.com/community/resources/post-content-find-replace.1549/

    Take a backup of your xf_post table at least, before doing anything.
  3. popowich

    popowich Active Member

    What about other fonts?

    It's wrong of me to always replace [/font] with "close quote" since it could have been used for other fonts?

    Unless there is a way to rig up that [/font] can also be used to close a quote?

    Then I'd only need to fix the code that opened the quotes.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not entirely sure what you mean by replacing font tags with quote tags as they are unrelated.

    BB code should always have opening and closing tags, otherwise it will result in malformed output.

    If there are erroneous tags and/or unclosed tags, they will all need to be dealt with.
  5. popowich

    popowich Active Member

    I think I'm losing my mind. With some searching it seems to not be too bad. Maybe it was an importer issue. I'm manually fixing several threads but it's manageable.
  6. popowich

    popowich Active Member

    I think I figured it out. It has to do with copied and pasted text from other sources into the forums, at least sometimes with non-standard fonts applied, and maybe actual quotes " " within that condition that did not import correctly sometimes too. They turned into broken font tags. Hope that helps. It's not a huge deal. A forum migrating millions of posts this might be a bigger concern since it could turn into more work than can be manually accomplished.

    BTW, I noticed that bullet lists all have an extra line space inserted above them now too, again, no huge deal, but I can't help but fix them when I see them so there isn't a gap in the post.
    Last edited: May 1, 2015
  7. popowich

    popowich Active Member

    Maybe indents. Watch for the next few members who do vB3 migrations to XenForo and when they're done use the search box to search for:


    And I think you'll be able to investigate from there. There might be an opportunity to improve the importer.
  8. rebelde

    rebelde Member

    Though this thread is old, I'll answer what I did:

    I replaced FONT=&quot with FONT="" or FONT=''.

    I also had to create a custom BBcode called something like [ zfont ] for font="Times,Arial" - those with commas in them and did a regex replace of all old font tags with commas in them.
    popowich likes this.

Share This Page