Not a bug Please do not change URLs if unfurl action is unsuccessful

AndyB

Well-known member
Affected version
XF v2.1 Beta 5
If we post a message with the following URL example:

https://www.example.com/example.mp4

after saving the message the URL is changed to:

[URL unfurl="true"]https://www.example.com/example.mp4[/URL]

This causes problems with Custom BB codes. Please do not change URLs if the unfurl action is unsuccessful.

Thank you.
 
This causes problems with Custom BB codes.
No, it doesn't. Custom BB codes should either use the built-in BBCode parser to generate a BBCode tree, or use regular expressions that allow for the possibility of parameters. If neither of these are being used, then that is a bug with the custom BB code, not with XF.

The unfurl parameter tells the parser that the unfurling has been attempted / completed, without needing to store this information in the database and fetch (potentially) hundreds of records for each post in a large thread. I'm sure you can understand how this would absolutely kill performance, no-one should ever fetch a completely unknown amount of records without any form of limitations like maximum rows or pagination.
 
We don’t know the unfurl is unsuccessful until after the post is first shown, by that point the post including the unfurl attribute is already there.

The unfurl attribute is ultimately an indicator that it is a normal URL that is posted on its own line.

I assume this might be something to do with a video BB code of some sort?

If that’s the case then you will just need to find a different approach that hooks into the autolink process before the unfurl attribute is set, this is basically how we ensure YouTube and other media site videos are still converted correctly without being unfurled.
 
Back
Top Bottom