X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;fp=index.php;h=f182ad2905f1851dae7b30a90dadd639f4e28751;hb=03cd3750fd26d2667ccdadb55fd4807be34e1d1c;hp=ce6a51c439fc40c6c79a2404f8fc4c19538da0a5;hpb=008d8b95ef7d7b5e8e79b633ecc6d0097e0b0e28;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index ce6a51c4..f182ad29 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ $1 ',$url); + return preg_replace('!((?:https?|ftp)://\S+[[:alnum:]]/?)!si','$1',$url); } // ------------------------------------------------------------------------------------------ // Sniff browser language to display dates in the right format automatically. @@ -1347,8 +1347,8 @@ function templateLinkList() $linklist.='
  • '.thumbnail($link['url']); $linklist.='
  • \n"; $i++; } @@ -1388,8 +1388,9 @@ function thumbnail($url) if ($domain=='imgur.com') { $path = parse_url($url,PHP_URL_PATH); - if (substr_count($path,'/')==1) return '
    '; + if (strpos($path,'/r/')==0) return '
    '; if (strpos($path,'/gallery/')==0) return '
    '; + if (substr_count($path,'/')==1) return '
    '; } if ($domain=='i.imgur.com') {