]> git.mxchange.org Git - friendica.git/blobdiff - include/Scrape.php
Merge branch 'pull'
[friendica.git] / include / Scrape.php
old mode 100755 (executable)
new mode 100644 (file)
index 1835892..9c23791
@@ -255,6 +255,11 @@ function scrape_feed($url) {
                                }
                        }
                }
+               // perhaps an RSS version 1 feed with a generic or incorrect content-type?
+               if(stristr($s,'</item>')) {
+                       $ret['feed_rss'] = $url;
+                       return $ret;
+               }
        }
 
        try {
@@ -452,10 +457,19 @@ function probe_url($url, $mode = PROBE_NORMAL) {
                                                        $adr = imap_rfc822_parse_adrlist($x->to,'');
                                                if(isset($adr)) {
                                                        foreach($adr as $feadr) {
-                                                               if((strcasecmp($feadr->mailbox,$name) == 0) 
-                                                                       &&(strcasecmp($feadr->host,$phost) == 0) 
+                                                               if((strcasecmp($feadr->mailbox,$name) == 0)
+                                                                       &&(strcasecmp($feadr->host,$phost) == 0)
                                                                        && (strlen($feadr->personal))) {
-                                                                       $vcard['fn'] = notags($feadr->personal);
+
+                                                                       $personal = imap_mime_header_decode($feadr->personal);
+                                                                       $vcard['fn'] = "";
+                                                                       foreach($personal as $perspart)
+                                                                               if ($perspart->charset != "default")
+                                                                                       $vcard['fn'] .= iconv($perspart->charset, 'UTF-8//IGNORE', $perspart->text);
+                                                                               else
+                                                                                       $vcard['fn'] .= $perspart->text;
+
+                                                                       $vcard['fn'] = notags($vcard['fn']);
                                                                }
                                                        }
                                                }
@@ -670,7 +684,7 @@ function probe_url($url, $mode = PROBE_NORMAL) {
 
        if(! x($vcard,'photo')) {
                $a = get_app();
-               $vcard['photo'] = $a->get_baseurl() . '/images/default-profile.jpg' ; 
+               $vcard['photo'] = $a->get_baseurl() . '/images/person-175.jpg' ; 
        }
 
        if(! $profile)