diff --git a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php
index d38d60529..9a3eba7cb 100644
--- a/lib/Cake/Test/Case/View/Helper/TextHelperTest.php
+++ b/lib/Cake/Test/Case/View/Helper/TextHelperTest.php
@@ -265,6 +265,10 @@ class TextHelperTest extends CakeTestCase {
'Text with a url http://www.not--work.com and more',
'Text with a url http://www.not--work.com and more',
),
+ array(
+ 'Text with a url http://www.sub_domain.domain.pl and more',
+ 'Text with a url http://www.sub_domain.domain.pl and more',
+ ),
array(
'Text with a partial www.küchenschöhn-not-working.de URL',
'Text with a partial www.küchenschöhn-not-working.de URL'
diff --git a/lib/Cake/View/Helper/TextHelper.php b/lib/Cake/View/Helper/TextHelper.php
index 451aa17b6..17ed5a4eb 100644
--- a/lib/Cake/View/Helper/TextHelper.php
+++ b/lib/Cake/View/Helper/TextHelper.php
@@ -104,7 +104,7 @@ class TextHelper extends AppHelper {
$this->_placeholders = array();
$options += array('escape' => true);
- $pattern = '#(?)((?:https?|ftp|nntp)://[\p{L}0-9.\-:]+(?:[/?][^\s<]*)?)#ui';
+ $pattern = '#(?)((?:https?|ftp|nntp)://[\p{L}0-9.\-_:]+(?:[/?][^\s<]*)?)#ui';
$text = preg_replace_callback(
$pattern,
array(&$this, '_insertPlaceHolder'),