From: Christian Weiske Date: Thu, 3 Oct 2013 18:14:27 +0000 (+0200) Subject: support non-http URLs in labeledURI fields (e.g. xmpp or mailto) X-Git-Tag: 0.8.0~4^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0a788e4a8e34395fc55479b39d176f123127c65b;p=contagged support non-http URLs in labeledURI fields (e.g. xmpp or mailto) --- diff --git a/inc/smarty/plugins/modifier.http.php b/inc/smarty/plugins/modifier.http.php index ecb52e7..f55ccb9 100644 --- a/inc/smarty/plugins/modifier.http.php +++ b/inc/smarty/plugins/modifier.http.php @@ -22,8 +22,8 @@ function smarty_modifier_http($string){ list($url,$name) = explode(' ',$string,2); - if(!preg_match('#^\w+://#',$url)){ - $url = 'http://'.$url; + if(!parse_url($url, PHP_URL_SCHEME)) { + $url = 'http://' . $url; } if(!$name) $name = $url;