]> git.mxchange.org Git - friendica.git/blobdiff - mod/salmon.php
trim webfinger request
[friendica.git] / mod / salmon.php
index 3c62a6d8c556bb6eff1676e8987ad601fd69b567..c2f76aa0a641889f583aa0b93e38b5c22f22b739 100644 (file)
@@ -89,7 +89,7 @@ function salmon_post(&$a) {
 
        // Create a fake feed wrapper so simplepie doesn't choke
 
-       $tpl = load_view_file('view/fake_feed.tpl');
+       $tpl = get_markup_template('fake_feed.tpl');
        
        $base = substr($data,strpos($data,'<entry'));
 
@@ -177,7 +177,7 @@ function salmon_post(&$a) {
        *
        */
 
-       $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `lrdd` = '%s') 
+       $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `alias` = '%s') 
                AND `uid` = %d LIMIT 1",
                dbesc($author_link),
                dbesc($author_link),
@@ -199,9 +199,16 @@ function salmon_post(&$a) {
 
        $hub = '';
 
-       // consume_feed will only accept a follow activity from this person if there is no contact record.
+       /**
+        *
+        * anti-spam measure: consume_feed will accept a follow activity from 
+        * this person (and nothing else) if there is no existing contact record.
+        *
+        */
 
-       consume_feed($feedxml,$importer,((count($r)) ? $r[0] : null),$hub);
+       $contact_rec = ((count($r)) ? $r[0] : null);
+
+       consume_feed($feedxml,$importer,$contact_rec,$hub);
 
        salmon_return(200);
 }