auto_link() learned to recognize more URLs
Problem:
auto_link() only works on URLs that are preceded by a new line, space, or open parentheses. As a result the URL in the string below would be missed.
'Google<br />http://www.google.com/'
Solution:
Add a word boundary to the list of features that can precede a URL.
Credit to: @scaryuncledevin, issue #419
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index 5d907d0..5d9afe4 100755
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -393,7 +393,7 @@
{
if ($type != 'email')
{
- if (preg_match_all("#(^|\s|\()((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches))
+ if (preg_match_all("#(^|\s|\(|\b)((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches))
{
$pop = ($popup == TRUE) ? " target=\"_blank\" " : "";