]> git.mxchange.org Git - friendica.git/commitdiff
Add scheme if missing to url inserted by user in 'insert link' jot
authorfabrixxm <fabrix.xm@gmail.com>
Sun, 22 Mar 2015 09:53:24 +0000 (10:53 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Sun, 22 Mar 2015 09:59:00 +0000 (10:59 +0100)
button

mod/parse_url.php

index cd2263dbe2622d8ae532ab87dcce935ac037b916..8920878a88a7af6b81aaf8507296004ef25d88de 100644 (file)
@@ -407,6 +407,15 @@ function parse_url_content(&$a) {
                }
        }
 
+       // add url scheme if missing
+       $arrurl = parse_url($url);
+       if (!x($arrurl, 'scheme')) {
+               if (x($arrurl, 'host'))
+                       $url = "http:".$url;
+               else
+                       $url = "http://".$url;
+       }
+
        logger('parse_url: ' . $url);
 
        if($textmode)
@@ -464,7 +473,7 @@ function parse_url_content(&$a) {
 
        if($siteinfo["title"] == "") {
                $sitedata .= sprintf($template,$url,$url,'') . $str_tags;
-               killme();
+               #killme();
        } else {
                $text = $siteinfo["text"];
                $title = $siteinfo["title"];