From 606fee0e2e0aa6a906db82e77090e91f133d7378 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 28 Jan 2013 12:57:13 +0200 Subject: Fix auto_link() for the Nth time - anchor() is for local links and breaks ones that don't have a protocol prefix - Allow :// links (no actual protocol specified) - Further simplified the URL regular expression --- tests/codeigniter/helpers/url_helper_test.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/codeigniter') diff --git a/tests/codeigniter/helpers/url_helper_test.php b/tests/codeigniter/helpers/url_helper_test.php index 5fc364238..24823a634 100644 --- a/tests/codeigniter/helpers/url_helper_test.php +++ b/tests/codeigniter/helpers/url_helper_test.php @@ -48,11 +48,12 @@ class Url_helper_test extends CI_TestCase { public function test_auto_link_url() { $strings = array( - 'www.codeigniter.com test' => 'http://www.codeigniter.com test', + 'www.codeigniter.com test' => 'www.codeigniter.com test', 'This is my noreply@codeigniter.com test' => 'This is my noreply@codeigniter.com test', - '
www.google.com' => '
http://www.google.com', - 'Download CodeIgniter at www.codeigniter.com. Period test.' => 'Download CodeIgniter at http://www.codeigniter.com. Period test.', - 'Download CodeIgniter at www.codeigniter.com, comma test' => 'Download CodeIgniter at http://www.codeigniter.com, comma test' + '
www.google.com' => '
www.google.com', + 'Download CodeIgniter at www.codeigniter.com. Period test.' => 'Download CodeIgniter at www.codeigniter.com. Period test.', + 'Download CodeIgniter at www.codeigniter.com, comma test' => 'Download CodeIgniter at www.codeigniter.com, comma test', + 'This one: ://codeigniter.com must not break this one: http://codeigniter.com' => 'This one: ://codeigniter.com must not break this one: http://codeigniter.com' ); foreach ($strings as $in => $out) @@ -66,7 +67,7 @@ class Url_helper_test extends CI_TestCase { public function test_pull_675() { $strings = array( - '
www.google.com' => '
http://www.google.com', + '
www.google.com' => '
www.google.com', ); foreach ($strings as $in => $out) -- cgit v1.2.3-24-g4f1b