Add scheme if missing to url inserted by user in 'insert link' jot
button
This commit is contained in:
parent
b2a86ceeaa
commit
1cc9e7db0f
|
@ -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)
|
||||||
|
@ -464,7 +473,7 @@ function parse_url_content(&$a) {
|
||||||
|
|
||||||
if($siteinfo["title"] == "") {
|
if($siteinfo["title"] == "") {
|
||||||
$sitedata .= sprintf($template,$url,$url,'') . $str_tags;
|
$sitedata .= sprintf($template,$url,$url,'') . $str_tags;
|
||||||
killme();
|
#killme();
|
||||||
} else {
|
} else {
|
||||||
$text = $siteinfo["text"];
|
$text = $siteinfo["text"];
|
||||||
$title = $siteinfo["title"];
|
$title = $siteinfo["title"];
|
||||||
|
|
Loading…
Reference in a new issue