[Pkg-owncloud-commits] [owncloud] 133/215: Correctly generate the feedback URL for remote share

David Prévot taffit at moszumanska.debian.org
Tue May 5 01:01:37 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 8f7c64253ed6f1165ede51d70c788160f3c26a91
Author: Joas Schilling <nickvergessen at owncloud.com>
Date:   Tue Apr 14 11:27:51 2015 +0200

    Correctly generate the feedback URL for remote share
    
    The trailing slash was added in c78e3c4a7fa1d2f474ab58551e67a50e093f6ed8
    to correctly generate the encryption keys
---
 apps/files_sharing/lib/external/manager.php | 2 +-
 lib/private/share/share.php                 | 4 ++--
 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 7b8b756..88f2571 100644
--- a/apps/files_sharing/lib/external/manager.php
+++ b/apps/files_sharing/lib/external/manager.php
@@ -235,7 +235,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 617eeeb..eeb50be 100644
--- a/lib/private/share/share.php
+++ b/lib/private/share/share.php
@@ -2426,7 +2426,7 @@ class Share extends 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('/');
 
@@ -2459,7 +2459,7 @@ class Share extends 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);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list