From ea79cf5d137fb3c78bdc3009256764c2849caea5 Mon Sep 17 00:00:00 2001 From: mark_story Date: Wed, 25 Feb 2015 20:52:35 -0500 Subject: [PATCH] Fix words with WWW in them being autolinked. Don't autolink words that don't have `www.` in them. Fixes #5968 --- lib/Cake/Test/Case/View/Helper/TextHelperTest.php | 4 ++++ lib/Cake/View/Helper/TextHelper.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php index 87d81b14a..a38fa38f1 100644 --- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php +++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php @@ -117,6 +117,10 @@ class TextHelperTest extends CakeTestCase { * @return void */ public function testAutoLink() { + $text = 'The AWWWARD show happened today'; + $result = $this->Text->autoLink($text); + $this->assertEquals($text, $result); + $text = 'This is a test text'; $expected = 'This is a test text'; $result = $this->Text->autoLink($text); diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php index 2a2a536b4..753434cc5 100644 --- a/lib/Cake/View/Helper/TextHelper.php +++ b/lib/Cake/View/Helper/TextHelper.php @@ -114,7 +114,7 @@ class TextHelper extends AppHelper { $text ); $text = preg_replace_callback( - '#(?)(?)(?