diff --git a/cake/libs/view/helpers/text.php b/cake/libs/view/helpers/text.php index 49aa9e4be..30c138a8c 100644 --- a/cake/libs/view/helpers/text.php +++ b/cake/libs/view/helpers/text.php @@ -109,7 +109,7 @@ class TextHelper extends AppHelper { $text = preg_replace_callback('#(?)((?:http|https|ftp|nntp)://[^ <]+)#i', create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], $matches[0],' . $options . ');'), $text); - return preg_replace_callback('#(?)(?)(?tags = $Html->loadConfig(); return $Html->link($matches[0], "http://" . strtolower($matches[0]),' . $options . ');'), $text); } /** diff --git a/cake/tests/cases/libs/view/helpers/text.test.php b/cake/tests/cases/libs/view/helpers/text.test.php index a0d5865ad..c4160c019 100644 --- a/cake/tests/cases/libs/view/helpers/text.test.php +++ b/cake/tests/cases/libs/view/helpers/text.test.php @@ -133,6 +133,11 @@ class TextTest extends UnitTestCase { $result = $this->Text->autoLinkUrls($text); $this->assertEqual($expected, $result); + $text = 'This is a test that includes (www.cakephp.org)'; + $expected = 'This is a test that includes (www.cakephp.org)'; + $result = $this->Text->autoLinkUrls($text); + $this->assertEqual($expected, $result); + $text = 'Text with a partial www.cakephp.org URL'; $expected = 'Text with a partial www.cakephp.org URL'; $result = $this->Text->autoLinkUrls($text);