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

Partial Fix youtube link autoembed bug

Discussion in 'Resolved Bug Reports' started by swatme, Nov 4, 2011.

  1. swatme

    swatme Well-Known Member

    Theres a bug in xf youtube autoembed with original url
    "Auto-embed media, and add a link to the content within this BB code"

    user post youtube video url

    Then xf will automatically convert that into embed with the original link below it.


    zzz.youtube.com/watch?v=1D4lw59ledI <--- note i change the www to zzz just to show the original link example


    when you quote the post, it will redouble the video embed
    due to the original link posted in the message will also be converted again to auto embed.
  2. Floris

    Floris Guest

    Confirmed, though I think this is working by design. I can't imagine why someone wants it to behave like this, perhaps this could be solved by having the <a href> rendered output include some micro data telling xenforo not to auto parse it or something.
    Screen shot 2011-11-04 at 4.48.36 PM.png
  3. Mike

    Mike XenForo Developer Staff Member

    I don't see any way of fully preventing unfortunately, short of just removing that part of the option. We adjusted the auto-embedding to be run on links where the text is the same as the URL. Thus there's really no way to distinguish this URL.

    The workaround is to make the text of the link be different from the URL. For example:
    [url={$url}]View: {$url}[/url]
    lasertits, Andrej and Jake Bunce like this.
  4. swatme

    swatme Well-Known Member

    just imagine a 10 part series youtube video posted in a single message
    then each one will quote it :D
    youtube flash videos makes your browser crawl to its feet.

    so next version would be best to fix it by changing the textlink name
    so that it will not be captured by autoembed
  5. Mike

    Mike XenForo Developer Staff Member

    I added a comment about how this could happen and changed the default link example to:
    [i][size=2][url={$url}]View: {$url}[/url][/size][/i]
    Which won't trigger the issue.
  6. mrGTB

    mrGTB Well-Known Member

    Are you sure that fix is working right? I just added it and take a look at this picture how the URL gets displayed. The link has been listed 2 times and there a visible ending URL BBCode bracket still left open

    ChemicalKicks likes this.
  7. mrGTB

    mrGTB Well-Known Member

    Sorry, ignore that above. It must have been a cache thing going on. I just tried disabling and re-enabling that option after changing the code and it appears to be working OK now. You must have to turn embed link off, then back on again for the change to kick in.
    ChemicalKicks likes this.
  8. ChemicalKicks

    ChemicalKicks Well-Known Member

    Turning it off and on again just reverted the original code, at least it did for me.
  9. Edrondol

    Edrondol Well-Known Member

    Are you saying...turn it off and back on again?

    ChemicalKicks likes this.
  10. ChemicalKicks

    ChemicalKicks Well-Known Member

    Doesn't work though :D
  11. lasertits

    lasertits Active Member

    Same, I also keep getting the issue mrGTB originally posted, can't seem to get Mike's partial fix to work no matter what I try... :confused:
  12. Brogan

    Brogan XenForo Moderator Staff Member

    Mike's aware of it and looking at it.
  13. Mike

    Mike XenForo Developer Staff Member

    Turns out the {$url} replacement was for [url]{$url}[/url], so I removed that and also fixed an issue with the default value for the field.
    lasertits likes this.
  14. Kyle12

    Kyle12 New Member

    Thanks Mike!
  15. ChemicalKicks

    ChemicalKicks Well-Known Member

    I must be daft, whats the fix?
    mrGTB likes this.
  16. mrGTB

    mrGTB Well-Known Member

    Your not on your own, I was thinking the same thing 5 minutes ago. He likes being cryptic does Mike?
  17. lasertits

    lasertits Active Member

    Perhaps he's implying it will be fixed in beta 6? :confused:
  18. DRE

    DRE Well-Known Member

    Can anyone confirm that quoted auto-embed links don't embed in XF 1.1.0 RC1?
  19. Edrondol

    Edrondol Well-Known Member

    Works on this site WYSIWYG. Loading on mine now to test.
  20. Mike

    Mike XenForo Developer Staff Member

    That wasn't the fix. The fix was to change the default embed code and to document this happening. The code I posted is basically the way you should work around it.

Share This Page