• 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

swatme

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



example:
user post youtube video url

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

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

Then

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.
 
F

Floris

Guest
#2
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
 

Mike

XenForo developer
Staff member
#3
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:
Code:
[url={$url}]View: {$url}[/url]
 

swatme

Well-known member
#4
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:
Code:
[url={$url}]View: {$url}[/url]
agree.
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
 

Mike

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

mrGTB

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

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

utube.png
 

mrGTB

Well-known member
#7
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

Well-known member
#8
Na
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.
Turning it off and on again just reverted the original code, at least it did for me.
 

Mike

XenForo developer
Staff member
#13
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.