diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index 675b32c99..193faa0fb 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/e_parse_class.php,v $
-| $Revision: 1.39 $
-| $Date: 2008-10-30 22:42:36 $
+| $Revision: 1.40 $
+| $Date: 2008-11-01 18:00:30 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -703,8 +703,10 @@ class e_parse
if ($pref['link_replace'] && !$opts['no_replace'])
{
$_ext = ($pref['links_new_window'] ? " rel=\"external\"" : "");
- $sub_blk = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<,]*)#is", "\\1".$pref['link_text']."", $sub_blk);
- $sub_blk = preg_replace("#(^|[\n \]])((www|ftp)\.[\w+-]+?\.[\w+\-.]*(?(?=/)(/.+?(?=\s|,\s))|(?=\W)))#is", "\\1".$pref['link_text']."", $sub_blk);
+// $sub_blk = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<,]*)#is", "\\1".$pref['link_text']."", $sub_blk);
+ $sub_blk = preg_replace("#(^|[\s\]=])([\w]+?://(?:[\w-%]+?)(?:\.[\w-%]+?)+.*?)(?=$|[\s,()[\]]|\.\s)#is", "\\1".$pref['link_text']."", $sub_blk);
+// $sub_blk = preg_replace("#(^|[\n \]])((www|ftp)\.[\w+-]+?\.[\w+\-.]*(?(?=/)(/.+?(?=\s|,\s))|(?=\W)))#is", "\\1".$pref['link_text']."", $sub_blk);
+ $sub_blk = preg_replace("#(^|[\s\]=])((?:www|ftp)(?:\.[\w-%]+?){2}.*?)(?=$|[\s,()[\]]|\.\s)#is", "\\1".$pref['link_text']."", $sub_blk);
if(CHARSET != "utf-8" && CHARSET != "UTF-8")
{
$email_text = ($pref['email_text']) ? $this->replaceConstants($pref['email_text']) : "\\1\\2©\\3";
@@ -717,8 +719,10 @@ class e_parse
}
else
{
- $sub_blk = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<,]*)#is", "\\1\\2", $sub_blk);
- $sub_blk = preg_replace("#(^|[\n \]])((www|ftp)\.[\w+-]+?\.[\w+\-.]*(?(?=/)(/.+?(?=\s|,\s))|(?=\W)))#is", "\\1\\2", $sub_blk);
+// $sub_blk = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<,]*)#is", "\\1\\2", $sub_blk);
+ $sub_blk = preg_replace("#(^|[\s\]=])([\w]+?://(?:[\w-%]+?)(?:\.[\w-%]+?)+.*?)(?=$|[\s,()[\]]|\.\s)#is", "\\1\\2", $sub_blk);
+// $sub_blk = preg_replace("#(^|[\n \]])((www|ftp)\.[\w+-]+?\.[\w+\-.]*(?(?=/)(/.+?(?=\s|,\s))|(?=\W)))#is", "\\1\\2", $sub_blk);
+ $sub_blk = preg_replace("#(^|[\s\]=])((?:www|ftp)(?:\.[\w-%]+?){2}.*?)(?=$|[\s,()[\]]|\.\s)#is", "\\1\\2", $sub_blk);
$sub_blk = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1".LAN_EMAIL_SUBS."", $sub_blk);
}
}