X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fnetwork.php;h=4bec4a172778db2c1c452b937787fe25a9f7aaac;hb=912e008ded3d439f7779310eb422e4b871a9b63d;hp=23ef50b21bd34095a68de6386bda7d180bf84bcf;hpb=14d68a0dc031b271d26e735160651da52b55d562;p=friendica.git diff --git a/include/network.php b/include/network.php index 23ef50b21b..4bec4a1727 100644 --- a/include/network.php +++ b/include/network.php @@ -172,7 +172,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0) $url_parsed = @parse_url($newurl); if (isset($url_parsed)) { $redirects++; - return fetch_url($newurl,$binary,$redirects,$timeout); + return fetch_url($newurl,false,$redirects,$timeout); } } $a->set_curl_code($http_code); @@ -206,6 +206,7 @@ function xml_status($st, $message = '') { if(! function_exists('http_status_exit')) { function http_status_exit($val) { + $err = ''; if($val >= 400) $err = 'Error'; if($val >= 200 && $val < 300) @@ -452,7 +453,7 @@ function lrdd($uri, $debug = false) { logger('lrdd: parse error: ' . $e); } - if($dom) { + if(isset($dom) && $dom) { $items = $dom->getElementsByTagName('link'); foreach($items as $item) { $x = $item->getAttribute('rel'); @@ -587,13 +588,14 @@ function fetch_xrd_links($url) { if(! function_exists('validate_url')) { function validate_url(&$url) { - // no naked subdomains - if(strpos($url,'.') === false) + + // no naked subdomains (allow localhost for tests) + if(strpos($url,'.') === false && strpos($url,'/localhost/') === false) return false; if(substr($url,0,4) != 'http') $url = 'http://' . $url; $h = @parse_url($url); - + if(($h) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR))) { return true; }