From 03cd3750fd26d2667ccdadb55fd4807be34e1d1c Mon Sep 17 00:00:00 2001 From: Seb Sauvage Date: Mon, 17 Oct 2011 22:14:14 +0200 Subject: =?UTF-8?q?Version=200.0.26=20beta:=20-=20Corrected:=20Removed=20e?= =?UTF-8?q?xtras=20space=20in=20description=20when=20URLs=20are=20converte?= =?UTF-8?q?d=20to=20clickable=20links.=20-=20Changed:=20Made=20permalink?= =?UTF-8?q?=20more=20visible=20(smallHash).=20-=20Corrected:=20Thumbnail?= =?UTF-8?q?=20for=20subreddit=20imgur=20urls=20(/r/=E2=80=A6)=20were=20cor?= =?UTF-8?q?rected=20(thanks=20to=20Accent=20Grave).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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') { -- cgit v1.2.3