[wp-cvs] wordpress/wp-includes functions-formatting.php,1.40,1.41

Matthew Mullenweg saxmatt at users.sourceforge.net
Sat Aug 28 08:40:16 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28613/wp-includes

Modified Files:
	functions-formatting.php 
Log Message:
Improved autolink function. http://mosquito.wordpress.org/bug_view_page.php?bug_id=0000236

Index: functions-formatting.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions-formatting.php,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** functions-formatting.php	23 Aug 2004 09:07:07 -0000	1.40
--- functions-formatting.php	28 Aug 2004 08:40:13 -0000	1.41
***************
*** 327,339 ****
  }
  
! function make_clickable($text) { // original function: phpBB, extended here for AIM & ICQ
!     $ret = " " . $text;
!     $ret = preg_replace("#([\n ])([a-z]+?)://([^, <>{}\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
!     $ret = preg_replace("#([\n ])aim:([^,< \n\r]+)#i", "\\1<a href=\"aim:goim?screenname=\\2\\3&message=Hello\">\\2\\3</a>", $ret);
!     $ret = preg_replace("#([\n ])icq:([^,< \n\r]+)#i", "\\1<a href=\"http://wwp.icq.com/scripts/search.dll?to=\\2\\3\">\\2\\3</a>", $ret);
!     $ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,< \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
!     $ret = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([^,< \n\r]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
!     $ret = substr($ret, 1);
!     return $ret;
  }
  
--- 327,337 ----
  }
  
! function make_clickable($ret) { // original function: phpBB
! 	$ret = ' ' . $ret . ' ';
! 	$ret = preg_replace("#(\s)http://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='http://$2'>http://$2</a>", $ret);
! 	$ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4'>www.$2.$3$4</a>", $ret);
! 	$ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href='mailto:$2@$3\">$2@$3</a>", $ret);
! 	$ret = trim($ret);
! 	return $ret;
  }
  




More information about the cvs mailing list