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

Fixed SMF Importer doesn't transfer [img] bbcode

Discussion in 'Resolved Bug Reports' started by jeffwidman, Dec 15, 2014.

  1. jeffwidman

    jeffwidman Active Member

    @Chris D --sorry to be dumping bug reports on you.

    Discovered some IMG BBCode that isn't showing up properly after I did the SMF import. I think it's because it includes width and height codes. I tried a few different variations, like putting the values in quotes, but nothing worked other than completely stripping out the width and height attributes--does Xenforo not support them in IMG tags?

    Here's an example:
    [img width=400 height=266]http://h.fastcompany.net/multisite_files/fastcompany/imagecache/slideshow_large/slideshow/2014/12/3039678-slide-s-6-star-wars-photos-by-thomas-dagg.jpg[/img]
    As soon as I strip out the width and height it works properly.

    Not sure if this falls within the scope of the importer, or something that manually should be handled by the admin. It's a fairly standard tag...
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    XenForo does not support width and height in IMG.
    jeffwidman likes this.
  3. Chris D

    Chris D XenForo Developer Staff Member

    We'll handle that in the next version of the importer with this:

    $string preg_replace('#\[img.*](.*)\[/img\]#siU''[IMG]$1[/IMG]'$string);
    Omar Bazavilvazo and jeffwidman like this.
  4. jeffwidman

    jeffwidman Active Member

    When I stick that in the find and replace, I get:

    Server Error
    preg_match_all(): Delimiter must not be alphanumeric or backslash
    preg_match_all() in PostReplace/ControllerAdmin/PostReplace.php at line 26
    PostReplace_ControllerAdmin_PostReplace->actionReplace() in XenForo/FrontController.php at line 347
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    XenForo_FrontController->run() in /home/nginx/domains/sportsjournalists.com/public/forum/admin.php at line 13
    I'm limiting the intial find to posts containing "img",
    using the Regex you suggested above for finding:
    As well as the replacement regex:
  5. Chris D

    Chris D XenForo Developer Staff Member

    The regex is:

    jeffwidman likes this.
  6. jeffwidman

    jeffwidman Active Member

  7. Chris D

    Chris D XenForo Developer Staff Member

    jeffwidman likes this.

Share This Page