X Tutup
Skip to content

Commit 8afe84d

Browse files
committed
share_id should be string according to \OCP\Share\IShare interface
1 parent 726357e commit 8afe84d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

apps/federatedfilesharing/lib/FederatedShareProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ private function getRawShare($id) {
878878
*/
879879
private function createShareObject($data) {
880880
$share = new Share($this->rootFolder, $this->userManager);
881-
$share->setId((int)$data['id'])
881+
$share->setId($data['id'])
882882
->setShareType((int)$data['share_type'])
883883
->setPermissions((int)$data['permissions'])
884884
->setTarget($data['file_target'])

apps/files_sharing/lib/ExpireSharesJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function run($argument) {
9696
$shares = $qb->execute();
9797
while ($share = $shares->fetch()) {
9898
try {
99-
$shareObject = $this->defaultShareProvider->getShareById($share['id']);
99+
$shareObject = $this->defaultShareProvider->getShareById((string)$share['id']);
100100
$this->shareManager->deleteShare($shareObject);
101101
} catch (ShareNotFound $ex) {
102102
//already deleted

lib/private/Share20/DefaultShareProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public function getAllSharesBy($userId, $shareTypes, $nodeIDs, $reshares) {
493493
}
494494
$cursor->closeCursor();
495495
}
496-
496+
497497
return $shares;
498498
}
499499

@@ -569,7 +569,7 @@ public function getShareById($id, $recipientId = null) {
569569
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
570570
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
571571
));
572-
572+
573573
$cursor = $qb->execute();
574574
$data = $cursor->fetch();
575575
$cursor->closeCursor();
@@ -945,7 +945,7 @@ public function getShareByToken($token) {
945945

946946
return $share;
947947
}
948-
948+
949949
/**
950950
* Create a share object from an database row
951951
*
@@ -955,7 +955,7 @@ public function getShareByToken($token) {
955955
*/
956956
private function createShare($data) {
957957
$share = new Share($this->rootFolder, $this->userManager);
958-
$share->setId((int)$data['id'])
958+
$share->setId($data['id'])
959959
->setShareType((int)$data['share_type'])
960960
->setPermissions((int)$data['permissions'])
961961
->setTarget($data['file_target'])
@@ -1086,7 +1086,7 @@ private function resolveGroupShares($shares, $userId) {
10861086
}
10871087
$stmt->closeCursor();
10881088
}
1089-
1089+
10901090
$resolvedShares = \array_values($shareIdToShareMap);
10911091
return $resolvedShares;
10921092
}

lib/public/Share/IShareProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offs
135135
* @since 10.0.0
136136
*/
137137
public function getAllSharesBy($userId, $shareTypes, $nodeIDs, $reshares);
138-
138+
139139
/**
140140
* Get share by id
141141
*
142-
* @param int $id
142+
* @param string $id
143143
* @param string|null $recipientId
144144
* @return \OCP\Share\IShare
145145
* @throws ShareNotFound
@@ -168,7 +168,7 @@ public function getSharesByPath(Node $path);
168168
* @since 10.0.0
169169
*/
170170
public function getAllSharedWith($userId, $node);
171-
171+
172172
/**
173173
* Get shared with the given user specifying share type predicate for this specific share provider
174174
*

0 commit comments

Comments
 (0)
X Tutup