Merge pull request #1442 from fabrixxm/issue-1362

Add scheme if missing to url inserted by user in 'insert link' jot button
This commit is contained in:
Michael Vogel 2015-03-24 12:34:31 +01:00
commit f1c6d6f1ba

View 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); logger('parse_url: ' . $url);
if($textmode) if($textmode)
@ -462,10 +471,7 @@ function parse_url_content(&$a) {
$sitedata = ""; $sitedata = "";
if($siteinfo["title"] == "") { if($siteinfo["title"] != "") {
$sitedata .= sprintf($template,$url,$url,'') . $str_tags;
killme();
} else {
$text = $siteinfo["text"]; $text = $siteinfo["text"];
$title = $siteinfo["title"]; $title = $siteinfo["title"];
} }