]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Support for magnet links in description.
[github/shaarli/Shaarli.git] / index.php
index 0253c19fd0ee8d50409a30caf5b5d7f9fc0d8684..448c23a6b0227947d201312a278e2312f10eb5de 100644 (file)
--- a/index.php
+++ b/index.php
@@ -99,7 +99,7 @@ function checkphpversion()
     if (version_compare(PHP_VERSION, '5.1.0') < 0)
     {
         header('Content-Type: text/plain; charset=utf-8');
-        echo 'Your server supports php '.PHP_VERSION.'. Shaarli requires at last php 5.1.0, and thus cannot run. Sorry.';
+        echo 'Your server supports php '.PHP_VERSION.'. Shaarli requires at least php 5.1.0, and thus cannot run. Sorry.';
         exit;
     }
 }
@@ -172,7 +172,7 @@ class pageCache
         if (is_dir($GLOBALS['config']['PAGECACHE']))
         {
             $handler = opendir($GLOBALS['config']['PAGECACHE']);
-            if ($handle!==false)
+            if ($handler!==false)
             {
                 while (($filename = readdir($handler))!==false) 
                 {
@@ -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