X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fnetwork.php;h=25db62d1611a0d4b78c8970981b03c5e1663abe5;hb=f5c5da742da1154c26277df7ff86eebea6ffe049;hp=e89eb94da24dc5b26c042a75a76b8b1cb8efb9a3;hpb=02281be0c3b19bcab3ae3a96475846104af11e92;p=friendica.git diff --git a/include/network.php b/include/network.php old mode 100644 new mode 100755 index e89eb94da2..25db62d161 --- a/include/network.php +++ b/include/network.php @@ -22,7 +22,7 @@ function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_ } @curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); - @curl_setopt($ch, CURLOPT_USERAGENT, "Friendika"); + @curl_setopt($ch, CURLOPT_USERAGENT, "Friendica"); if(intval($timeout)) { @@ -105,7 +105,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0) curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$params); - curl_setopt($ch, CURLOPT_USERAGENT, "Friendika"); + curl_setopt($ch, CURLOPT_USERAGENT, "Friendica"); if(intval($timeout)) { curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); @@ -535,6 +535,9 @@ function fetch_xrd_links($url) { if ((! $xml) || (! stristr($xml,''),array('href="','"/>'),$xml); + $h = parse_xml_string($xml); if(! $h) return array(); @@ -576,6 +579,9 @@ function fetch_xrd_links($url) { if(! function_exists('validate_url')) { function validate_url(&$url) { + // no naked subdomains + if(strpos($url,'.') === false) + return false; if(substr($url,0,4) != 'http') $url = 'http://' . $url; $h = @parse_url($url);