From 793cc2b3cfedcf067df8a8c88f516c68f30d72a2 Mon Sep 17 00:00:00 2001 From: has2k1 Date: Thu, 17 Nov 2011 11:04:27 -0700 Subject: 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
http://www.google.com/' Solution: Add a word boundary to the list of features that can precede a URL. Credit to: @scaryuncledevin, issue #419 --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 5d907d00e..5d9afe457 100755 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -393,7 +393,7 @@ if ( ! function_exists('auto_link')) { 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\" " : ""; -- cgit v1.2.3-24-g4f1b From 9001a882424aaf4edc67552d3beecb9283fa1bdd Mon Sep 17 00:00:00 2001 From: has2k1 Date: Sun, 20 Nov 2011 00:53:32 -0700 Subject: Update user_guide_src/source/changelog.rst --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index a071e5a66..1bd0976ba 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -57,6 +57,7 @@ Bug fixes for 3.0 - Unlink raised an error if cache file did not exist when you try to delete it. - Fixed a bug (#181) where a mis-spelling was in the form validation language file. +- Bug #419 - auto_link() now recognizes URLs that come after a word boundary. Version 2.1.0 -- cgit v1.2.3-24-g4f1b From bc204813956771e83d10c3b04e22bb5874938a99 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Sun, 27 Nov 2011 01:12:45 -0500 Subject: Updated docs for increment_string example. --- user_guide_src/source/helpers/string_helper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst index b8a69e036..dc70e461a 100644 --- a/user_guide_src/source/helpers/string_helper.rst +++ b/user_guide_src/source/helpers/string_helper.rst @@ -58,7 +58,7 @@ Usage example echo increment_string('file', '_'); // "file_1" echo increment_string('file', '-', 2); // "file-2" - echo increment_string('file-4'); // "file-5" + echo increment_string('file_4'); // "file_5" alternator() ============ -- cgit v1.2.3-24-g4f1b