SOURCES: eventum-link_filter-updates.patch (NEW) - add to PLD CVS

glen glen at pld-linux.org
Thu Dec 29 21:40:41 CET 2005


Author: glen                         Date: Thu Dec 29 20:40:41 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- add to PLD CVS

---- Files affected:
SOURCES:
   eventum-link_filter-updates.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/eventum-link_filter-updates.patch
diff -u /dev/null SOURCES/eventum-link_filter-updates.patch:1.1
--- /dev/null	Thu Dec 29 21:40:41 2005
+++ SOURCES/eventum-link_filter-updates.patch	Thu Dec 29 21:40:36 2005
@@ -0,0 +1,21 @@
+--- eventum-20051227/include/class.misc.php	2005-12-27 15:35:26.000000000 +0200
++++ /tmp/class.misc.php	2005-12-27 15:34:41.000000000 +0200
+@@ -504,10 +497,15 @@
+      * @param   string $class The CSS class to use on the actual links
+      * @return  string The parsed string
+      */
+-    function activateLinks($text, $class = "link")
++    function activateLinks($text, $class = 'link')
+     {
+-        $text = preg_replace("'(\w+)://([\w\+\-\@\=\?\.\%\/\:\&\;~\|]+)(\.)?'", "<a title=\"open \\1://\\2 in a new window\" class=\"$class\" href=\"\\1://\\2\" target=\"_\\2\">\\1://\\2</a>", $text);
+-        $text = preg_replace("'(\s+)www\.([\w\+\-\@\=\?\.\%\/\:\&\;~\|]+)(\.\s|\s)'", "\\1<a title=\"open http://www.\\2 in a new window\" class=\"$class\" href=\"http://www.\\2\" target=\"_\\2\">www.\\2</a>\\3" , $text);
++        $range = '[-\w+@=?.%/:&;~|,#]+';
++        $text = preg_replace("'(\w+)://($range)(\.)?'", '<a title="open $1://$2 in a new window" class="' . $class . '" href="$1://$2" target="_$2">$1://$2</a>', $text);
++        $text = preg_replace("'(\s+)(www\.$range)(\.\s|\s)'", '$1<a title="open http://$2 in a new window" class="' . $class . '" href="http://$2" target="_$2">$2</a>$3' , $text);
++
++        $mail_pat = '/([-+a-z0-9_.]+@(?:[-a-z0-9_.]{2,63}\.)+[a-z]{2,6})/i';
++        $text = preg_replace($mail_pat, '<a title="open mailto:$1 in a new window" class="' . $class . '" href="mailto:$1" target="_$1">$1</a>' , $text);
++
+         return $text;
+     }
+ 
================================================================


More information about the pld-cvs-commit mailing list