]> git.mxchange.org Git - friendica.git/blobdiff - include/network.php
attribution issue - don't take author name from contact if available from item.
[friendica.git] / include / network.php
old mode 100644 (file)
new mode 100755 (executable)
index 78ed240..25db62d
@@ -535,6 +535,9 @@ function fetch_xrd_links($url) {
        if ((! $xml) || (! stristr($xml,'<xrd')))
                return array();
 
+       // fix diaspora's bad xml
+       $xml = str_replace(array('href=&quot;','&quot;/>'),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);