]> git.mxchange.org Git - friendica.git/commitdiff
fixes share from diaspora
authorFriendika <info@friendika.com>
Mon, 15 Aug 2011 12:27:24 +0000 (05:27 -0700)
committerFriendika <info@friendika.com>
Mon, 15 Aug 2011 12:27:24 +0000 (05:27 -0700)
include/Scrape.php
include/diaspora.php
mod/receive.php

index b32d7283e5572f41870190b4b30ed7f0565db427..bfe795e19dac51bfd04d74f0734442035ac021bb 100644 (file)
@@ -494,7 +494,7 @@ function probe_url($url) {
 
                if($check_feed) {
 
-                       $feedret = scrape_feed($url);
+                       $feedret = scrape_feed(($poll) ? $poll : $url);
                        logger('probe_url: scrape_feed returns: ' . print_r($feedret,true), LOGGER_DATA);
                        if(count($feedret) && ($feedret['feed_atom'] || $feedret['feed_rss'])) {
                                $poll = ((x($feedret,'feed_atom')) ? unamp($feedret['feed_atom']) : unamp($feedret['feed_rss']));
index 38ee8c1e5379b13e8960425e7611633e2fd1d22a..edb273d3cfb0a35af7dd50865a4ec0f78971778d 100644 (file)
@@ -116,6 +116,8 @@ EOT;
 
 function diaspora_decode($importer,$xml) {
 
+
+
        $basedom = parse_xml_string($xml);
 
        $atom = $basedom->children(NAMESPACE_ATOM1);
@@ -129,7 +131,7 @@ function diaspora_decode($importer,$xml) {
        openssl_private_decrypt($encrypted_aes_key_bundle,$outer_key_bundle,$importer['prvkey']);
 
        $j_outer_key_bundle = json_decode($outer_key_bundle);
-
+logger('outer: ' . $j_outer_key_bundle);
        $outer_iv = base64_decode($j_outer_key_bundle->iv);
        $outer_key = base64_decode($j_outer_key_bundle->key);
 
@@ -150,6 +152,7 @@ function diaspora_decode($importer,$xml) {
         *  </decrypted_header>
         */
 
+       logger('decrypted: ' . $decrypted);
        $idom = parse_xml_string($decrypted,false);
 
        $inner_iv = base64_decode($idom->iv);
@@ -301,8 +304,8 @@ function diaspora_request($importer,$contact,$xml) {
        $hash = random_string() . (string) time();   // Generate a confirm_key
        
        if(is_array($contact_record)) {
-               $ret = q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `note`, `hash`, `datetime`)
-                       VALUES ( %d, %d, 1, %d, '%s', '%s', '%s' )",
+               $ret = q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `note`, `hash`, `datetime`,`blocked`)
+                       VALUES ( %d, %d, 1, %d, '%s', '%s', '%s', 0 )",
                        intval($importer['uid']),
                        intval($contact_record['id']),
                        0,
index 72d528093bd53fe3bf5aad01b0b03478be01f45a..43f8c7bbcd36b05b23fb306def746c7e47b7a3c9 100644 (file)
@@ -26,7 +26,7 @@ function receive_post(&$a) {
 
        $importer = $r[0];
 
-       $xml = $_POST['xml'];
+       $xml = urldecode($_POST['xml']);
 
        logger('mod-diaspora: new salmon ' . $xml, LOGGER_DATA);
 
@@ -38,7 +38,7 @@ function receive_post(&$a) {
                http_status_exit(500);
 
 
-       $parsed_xml = parse_xml_string($msg);
+       $parsed_xml = parse_xml_string($msg,false);
 
        $xmlbase = $parsed_xml->post;