#21869 [Dup->Csd]: Link and Mailto parsing functions

From: Date: Fri, 24 Jan 2003 22:48:53 +0000
Subject: #21869 [Dup->Csd]: Link and Mailto parsing functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31192@lists.php.net to get a copy of this message
ID: 21869 User updated by: spoon@nexdot.net Reported By: spoon@nexdot.net -Status: Duplicate +Status: Closed Bug Type: Feature/Change Request Operating System: XP Pro PHP Version: 5CVS-2003-01-24 (dev) New Comment: closed Previous Comments: ------------------------------------------------------------------------ [2003-01-24 16:48:07] spoon@nexdot.net /include/functions.inc (i was forgetting /include) function addlinks($text) { $text = htmlspecialchars($text); $text = preg_replace("/((mailto|http|ftp|nntp|news):.+?)(&gt;|\\s|\\)|\\.\\s|$)/i","<a href=\"\\1\">\\1</a>\\3",$text); # what the heck is this for? $text = preg_replace("/[.,]?-=-\"/", '"', $text); return $text; } WOOOO. PHP.NET RULES! ------------------------------------------------------------------------ [2003-01-24 16:45:00] spoon@nexdot.net In the source of your bug.php, at the very bottom it has a line: $note = addlinks(preg_replace("/(\r?\n){3,}/","\n\n",wordwrap($comment,72,"\n",1))); addlinks is not defined in the source, so i am assuming it is in prepend.inc (?), but unfortunatley, we cannot view .inc files using source.php, any help? ------------------------------------------------------------------------ [2003-01-24 16:32:41] spoon@nexdot.net Pear does not have this ability, as far as i can see from pear.php.net ------------------------------------------------------------------------ [2003-01-24 16:21:03] tal@php.net Dup of #6893. ------------------------------------------------------------------------ [2003-01-24 16:13:37] spoon@nexdot.net THIS PAGE DOES IT! (NOT THE EMAIL THOUGH) (but it is a non full proof regex?) Still, if it is a GOOD regex, that almost never messes up, a function would be ... easier :D ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21869 -- Edit this bug report at http://bugs.php.net/?id=21869&edit=1

« previous php.bugs (#31192) next »