Fixed Autolinking affected by short code to emoji replacements

Affected version
XF v2.1.0

AndyB

Well-known member
When I paste a link from eBay it will not unfurl.

Example of typical eBay URL:

Code:
https://www.ebay.com/itm/KTM-690-Duke-Front-Headlight-Assembly-2012-2018/333068937357?hash=item4d8c74a88d:g:Ti8AAOSwaEZcYgpA:rk:1:pf:0
After saving the post, the link will show like this with the emoji added at the end:

195719

If I remove everything after the ? in the URL like this example:

Code:
https://www.ebay.com/itm/KTM-690-Duke-Front-Fender-2012-2018/333068911386
the unfurl functions correctly:

195720
 

gouwepeer.nl

Active member
The last part of the first url is creating a emoji. That emoji create a wrong url. The problem is the :pf: in the end of the url.
 

Steffen

Well-known member
When posting the following text, XenForo turns emoji shortcodes like :flag_pf: into an emoji (and thus breaks the URL):

https://www.example.org/?foo=:flag_pf:&bar=1

There is no issue if I manually enclose the URL in "URL" bb codes like this (instead of letting XenForo auto-link it):

[URL]https://www.example.org/?foo=:flag_pf:&bar=1[/URL]
https://www.example.org/?foo=:flag_pf:&bar=1

It seems like XenForo first replaces emoji shortcodes and then auto-links URLs. It should work the other way around.

You can see the real non-reduced eBay URL where this has happened here: https://www.computerbase.de/forum/threads/lte-richtfunkantenne-telekom-hybrid.1856800/post-22329347
 
Last edited:

Steffen

Well-known member
Thanks for moving my post. Please note that the issue I reported seems unrelated to unfurling (we have not enabled URL unfurling).
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.1).

Change log:
Use a slightly more strict regex when detecting shortcodes in order to not necessarily attempt to replace embedded shortcodes, especially those inside URLs.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Top