]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Support for magnet links in description.
authorSébastien SAUVAGE <sebsauvage@sebsauvage.net>
Wed, 27 Feb 2013 14:49:32 +0000 (15:49 +0100)
committerSébastien SAUVAGE <sebsauvage@sebsauvage.net>
Wed, 27 Feb 2013 14:49:32 +0000 (15:49 +0100)
index.php

index 3349ff7af8414a1f8113284bfc79da3107be0713..448c23a6b0227947d201312a278e2312f10eb5de 100644 (file)
--- a/index.php
+++ b/index.php
@@ -223,7 +223,7 @@ function smallHash($text)
 function text2clickable($url)
 {
     $redir = empty($GLOBALS['redirector']) ? '' : $GLOBALS['redirector'];
-    return preg_replace('!(((?:https?|ftp|file)://|apt:)\S+[[:alnum:]]/?)!si','<a href="'.$redir.'$1" rel="nofollow">$1</a>',$url);
+    return preg_replace('!(((?:https?|ftp|file)://|apt:|magnet:)\S+[[:alnum:]]/?)!si','<a href="'.$redir.'$1" rel="nofollow">$1</a>',$url);
 }
 
 // This function inserts &nbsp; where relevant so that multiple spaces are properly displayed in HTML