summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-04-14 11:27:51 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2015-05-04 10:45:57 +0200
commit3dbe7e195c225fd0b322c594d724971641847f15 (patch)
tree10f45c703a05a5f71d7c7500df35d9ccdc2180c0
parent5b5bf27653455e63f6926356a0ffdf3eea479cc8 (diff)
downloadnextcloud-server-3dbe7e195c225fd0b322c594d724971641847f15.tar.gz
nextcloud-server-3dbe7e195c225fd0b322c594d724971641847f15.zip
Correctly generate the feedback URL for remote share
The trailing slash was added in c78e3c4a7fa1d2f474ab58551e67a50e093f6ed8 to correctly generate the encryption keys
-rw-r--r--apps/files_sharing/lib/external/manager.php2
-rw-r--r--lib/private/share/share.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php
index 1d937c29043..860554a35d8 100644
--- a/apps/files_sharing/lib/external/manager.php
+++ b/apps/files_sharing/lib/external/manager.php
@@ -217,7 +217,7 @@ class Manager {
*/
private function sendFeedbackToRemote($remote, $token, $id, $feedback) {
- $url = $remote . \OCP\Share::BASE_PATH_TO_SHARE_API . '/' . $id . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT;
+ $url = rtrim($remote, '/') . \OCP\Share::BASE_PATH_TO_SHARE_API . '/' . $id . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT;
$fields = array('token' => $token);
$result = $this->httpHelper->post($url, $fields);
diff --git a/lib/private/share/share.php b/lib/private/share/share.php
index a548698a61e..56fbc447f3c 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -2320,7 +2320,7 @@ class Share extends \OC\Share\Constants {
list($user, $remote) = explode('@', $shareWith, 2);
if ($user && $remote) {
- $url = $remote . self::BASE_PATH_TO_SHARE_API . '?format=' . self::RESPONSE_FORMAT;
+ $url = rtrim($remote, '/') . self::BASE_PATH_TO_SHARE_API . '?format=' . self::RESPONSE_FORMAT;
$local = \OC::$server->getURLGenerator()->getAbsoluteURL('/');
@@ -2353,7 +2353,7 @@ class Share extends \OC\Share\Constants {
* @return bool
*/
private static function sendRemoteUnshare($remote, $id, $token) {
- $url = $remote . self::BASE_PATH_TO_SHARE_API . '/' . $id . '/unshare?format=' . self::RESPONSE_FORMAT;
+ $url = rtrim($remote, '/') . self::BASE_PATH_TO_SHARE_API . '/' . $id . '/unshare?format=' . self::RESPONSE_FORMAT;
$fields = array('token' => $token, 'format' => 'json');
$result = self::tryHttpPost($url, $fields);
$status = json_decode($result['result'], true);