Skip to content

Commit 6b515a4

Browse files
committed
fix(ocm): format notifications
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 9dfd6f1 commit 6b515a4

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

apps/federatedfilesharing/lib/Notifications.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,9 @@ protected function tryLegacyEndPoint($remoteDomain, $urlSuffix, array $fields) {
361361
protected function tryOCMEndPoint($remoteDomain, $fields, $action) {
362362
switch ($action) {
363363
case 'share':
364+
$shareRemoteDomain = (!str_contains($remoteDomain, '://')) ? $remoteDomain : parse_url($remoteDomain, PHP_URL_HOST);
364365
$share = $this->cloudFederationFactory->getCloudFederationShare(
365-
$fields['shareWith'] . '@' . $remoteDomain,
366+
$fields['shareWith'] . '@' . $shareRemoteDomain,
366367
$fields['name'],
367368
'',
368369
$fields['remoteId'],

lib/private/Federation/CloudFederationNotification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function setMessage($notificationType, $resourceType, $providerId, array
3232
$this->message = [
3333
'notificationType' => $notificationType,
3434
'resourceType' => $resourceType,
35-
'providerId' => $providerId,
35+
'providerId' => (string)$providerId,
3636
'notification' => $notification,
3737
];
3838
}

lib/private/Federation/CloudFederationShare.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function setDescription($description) {
124124
* @since 14.0.0
125125
*/
126126
public function setProviderId($providerId) {
127-
$this->share['providerId'] = $providerId;
127+
$this->share['providerId'] = (string)$providerId;
128128
}
129129

130130
/**

0 commit comments

Comments
 (0)