MyBB Community Forums

Full Version: MyBB not auto detecting https urls in posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
https://example.com will not be a link, but http://example.com will be.
How can I get MyBB to automatically make https urls links? Also, why is this not done by default?
It obviously isn't part of the parser. It's usually better to use the [url] tags anyway isn't it?
I just edited line 1011 of class_parser.php to support this.

What I used:
		$message = preg_replace("#([\>\s\(\)])(http|https|ftp|news){1}://([^\/\"\s\<\[\.]+\.([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/[^\"\s<\[]*)?)#i", "$1[url]$2://$3[/url]", $message);

Can you explain where to find that file?
And can we just replace the old code with your new or what should we do?
It's at inc/class_parser.php.

That is what I did.
I assume you replace:
(http|ftp|news)

With:
(http|https|ftp|news)
This is fixed for 1.6.1 I believe.
(2010-08-08, 06:25 PM)dmmcintyre3 Wrote: [ -> ]I just edited line 1011 of class_parser.php to support this.

What I used:
		$message = preg_replace("#([\>\s\(\)])(http|https|ftp|news){1}://([^\/\"\s\<\[\.]+\.([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/[^\"\s<\[]*)?)#i", "$1[url]$2://$3[/url]", $message);

Thanks!
this worked for me...