]> git.sur5r.net Git - contagged/commitdiff
support non-http URLs in labeledURI fields (e.g. xmpp or mailto)
authorChristian Weiske <cweiske@cweiske.de>
Thu, 3 Oct 2013 18:14:27 +0000 (20:14 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 3 Oct 2013 18:14:27 +0000 (20:14 +0200)
inc/smarty/plugins/modifier.http.php

index ecb52e76b0f9df53b79f7fdc2c25b22e4d4579e2..f55ccb96dc30d2d8d571a85474cc27038371de61 100644 (file)
@@ -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;