MyBB Community Forums

Full Version: Unexpected URL omitting / shortening
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When using [url=#link]#text[/url] to display a link with some descriptive text, it's expected to show the full #text. However with the #text part being a URL, it gets shortened.

For example:
[url=https://github.com/mybb/mybb/blob/mybb_1829/inc/db_mysql.php#L682-L709]https://github.com/mybb/mybb/blob/mybb_1829/inc/db_mysql.php#L682-L709[/url] will output as
https://github.com/mybb/mybb/blob/mybb_1...#L682-L709
which is same as the output of
https://github.com/mybb/mybb/blob/mybb_1...#L682-L709

PS, the code of the above example is as follows

For example:
`[url=https://github.com/mybb/mybb/blob/mybb_1829/inc/db_mysql.php#L682-L709]https://github.com/mybb/mybb/blob/mybb_1829/inc/db_mysql.php#L682-L709[/url]` will output as
[url=https://github.com/mybb/mybb/blob/mybb_1829/inc/db_mysql.php#L682-L709]https://github.com/mybb/mybb/blob/mybb_1829/inc/db_mysql.php#L682-L709[/url]
which is same as the output of
[url=https://github.com/mybb/mybb/blob/mybb_1829/inc/db_mysql.php#L682-L709]https://github.com/mybb/mybb/blob/mybb_1...#L682-L709[/url]
It seems to happen only on exact match: https://github.com/mybb/mybb/blob/mybb_1....php#L1188

It may be there to account for simple links http://..., [url]http://...[/url] being saved as [url=http://...]http://...[/url], or for how parameters are passed to the method when simple links are matched (https://github.com/mybb/mybb/blob/mybb_1....php#L1743).