]> git.mxchange.org Git - friendica.git/commitdiff
bug #111 - don't parse an @ address as a feed
authorFriendika <info@friendika.com>
Mon, 1 Aug 2011 23:15:37 +0000 (16:15 -0700)
committerFriendika <info@friendika.com>
Mon, 1 Aug 2011 23:15:37 +0000 (16:15 -0700)
boot.php
include/Scrape.php

index 4d4b385122a1a54be13847e18cdb4bc77fc46e42..113f5d72c1d73aaa96c28da186c8cbaf971c046c 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1,6 +1,6 @@
 <?php
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1058' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1059' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1076      );
 
@@ -1743,10 +1743,12 @@ function fetch_xrd_links($url) {
 
 
        $xml = fetch_url($url);
-       if (! $xml)
-               return array();
 
        logger('fetch_xrd_links: ' . $xml, LOGGER_DATA);
+
+       if ((! $xml) || (! stristr($xml,'<xrd')))
+               return array();
+
        $h = parse_xml_string($xml);
        if(! $h)
                return array();
index 6726d0b1518d815b5ebc05bca6c5bc88ba6d3f46..9bf89a49eda8952e51d86dcf0450ffefb5f13e12 100644 (file)
@@ -294,6 +294,8 @@ function probe_url($url) {
 
        $twitter = ((strpos($url,'twitter.com') !== false) ? true : false);
 
+       $at_addr = ((strpos($url,'@') !== false) ? true : false);
+
        if(! $twitter) {
                $links = lrdd($url);
 
@@ -452,7 +454,7 @@ function probe_url($url) {
                                $vcard['fn'] = $vcard['nick'];
 
        
-               if(((! isset($vcard)) && (! $poll)) || ($twitter)) {
+               if(((! isset($vcard)) && (! $poll) && (! $at_addr)) || ($twitter)) {
 
                        $feedret = scrape_feed($url);
                        logger('probe_url: scrape_feed returns: ' . print_r($feedret,true), LOGGER_DATA);