diff options
author | Friendika <info@friendika.com> | 2011-08-19 02:24:30 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-19 02:24:30 -0700 |
commit | 395faae0b2eee4a134799f55b17784487088eb41 (patch) | |
tree | 07496dda986a4c5f694d9719b1b893bf0fd72830 | |
parent | 4cef4ec918db7d2f4f5902b4a731f4076a98084d (diff) | |
download | volse-hubzilla-395faae0b2eee4a134799f55b17784487088eb41.tar.gz volse-hubzilla-395faae0b2eee4a134799f55b17784487088eb41.tar.bz2 volse-hubzilla-395faae0b2eee4a134799f55b17784487088eb41.zip |
double url encode diaspora communications
-rw-r--r-- | include/diaspora.php | 21 | ||||
-rw-r--r-- | include/notifier.php | 3 | ||||
-rw-r--r-- | mod/receive.php | 2 |
3 files changed, 17 insertions, 9 deletions
diff --git a/include/diaspora.php b/include/diaspora.php index 44772d431..9b3969b73 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -792,7 +792,7 @@ function diaspora_share($me,$contact) { '$recipient' => $theiraddr )); - $slap = 'xml=' . urlencode(diaspora_msg_build($msg,$me,$contact,$me['prvkey'],$contact['pubkey'])); + $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$me,$contact,$me['prvkey'],$contact['pubkey']))); post_url($contact['notify'],$slap); $return_code = $a->get_curl_code(); @@ -823,7 +823,7 @@ function diaspora_send_status($item,$owner,$contact) { logger('diaspora_send_status: base message: ' . $msg, LOGGER_DATA); - $slap = 'xml=' . urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey'])); + $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey']))); post_url($contact['notify'],$slap); $return_code = $a->get_curl_code(); @@ -835,7 +835,7 @@ function diaspora_send_status($item,$owner,$contact) { function diaspora_send_followup($item,$owner,$contact) { $a = get_app(); - $myaddr = $me['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); + $myaddr = $owner['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); $theiraddr = $contact['addr']; $p = q("select guid from item where parent = %d limit 1", @@ -864,7 +864,7 @@ function diaspora_send_followup($item,$owner,$contact) { if($like) $signed_text = $item['guid'] . ';' . $target_type . ';' . $positive . ';' . $myaddr; else - $signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . $myaddr; + $signed_text = $item['guid'] . ';' . $parent_guid . ';' . $text . ';' . $myaddr; $authorsig = base64_encode(rsa_sign($signed_text,$owner['uprvkey'])); @@ -873,14 +873,14 @@ function diaspora_send_followup($item,$owner,$contact) { '$parent_guid' => xmlify($parent_guid), '$target_type' =>xmlify($target_type), '$authorsig' => xmlify($authorsig), - '$text' => xmlify($text), + '$body' => xmlify($text), '$positive' => xmlify($positive), - '$diaspora_handle' => xmlify($myaddr) + '$handle' => xmlify($myaddr) )); logger('diaspora_followup: base message: ' . $msg, LOGGER_DATA); - $slap = 'xml=' . urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey'])); + $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey']))); post_url($contact['notify'],$slap); $return_code = $a->get_curl_code(); @@ -893,6 +893,11 @@ function diaspora_send_followup($item,$owner,$contact) { function diaspora_send_relay($item,$owner,$contact) { + $a = get_app(); + $myaddr = $owner['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); + $theiraddr = $contact['addr']; + + $p = q("select guid from item where parent = %d limit 1", $item['parent'] ); @@ -951,7 +956,7 @@ function diaspora_send_relay($item,$owner,$contact) { logger('diaspora_relay_comment: base message: ' . $msg, LOGGER_DATA); - $slap = 'xml=' . urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey'])); + $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['uprvkey'],$contact['pubkey']))); post_url($contact['notify'],$slap); $return_code = $a->get_curl_code(); diff --git a/include/notifier.php b/include/notifier.php index 8572b53dd..cf8871fb9 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -502,7 +502,8 @@ function notifier_run($argv, $argc){ } break; case NETWORK_DIASPORA: - if(get_config('system','dfrn_only') || (! get_config('diaspora_enabled')) || (! $normal_mode)) + require_once('include/diaspora.php'); + if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode)) break; if($target_item['verb'] === ACTIVITY_DISLIKE) { diff --git a/mod/receive.php b/mod/receive.php index 19c163967..c3738c143 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -15,6 +15,8 @@ function receive_post(&$a) { if($a->argc != 3 || $a->argv[1] !== 'users') http_status_exit(500); + logger('receive: raw input: ' . file_get_contents('php://input'), LOGGER_DATA); + $guid = $a->argv[2]; $r = q("SELECT * FROM `user` WHERE `guid` = '%s' LIMIT 1", |