Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
BBCode url autolinker?
How would I go about making the BBCode plugin autolink urls?
0
This discussion has been closed.
Comments
For those that want to do it:
Add this to your BBCode.php extension (at the bottom.. anywhere really, just not in another function):
function AutoLink($String) {
// autolink example from www.zend.com (Code Gallery ) by http://www.zend.com/search_code_author.php?author=goten
return preg_replace("/(?<!<a href=\")(?<!\")(?<!\">)((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+)/","\\1",$String);
}
Then search for this:
}
return $String;
and above that add:
$String = $this->AutoLink($String);
That's it.