Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit c2322a3

Browse files
committed
Fix share action in rest mode : share worked but metadata was not correctly updated.
1 parent e744027 commit c2322a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/plugins/action.share/class.ShareCenter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ public function switchAction($action, $httpVars, $fileVars)
198198
$httpVars["simple_right_read"] = $httpVars["simple_right_download"] = "true";
199199
}
200200
}
201-
$file = AJXP_Utils::decodeSecureMagic($httpVars["file"]);
202-
$ajxpNode = new AJXP_Node($this->urlBase.$file);
201+
$userSelection = new UserSelection(ConfService::getRepository(), $httpVars);
202+
$file = $userSelection->getUniqueFile();
203+
$ajxpNode = $userSelection->getUniqueNode();
203204
if (!file_exists($ajxpNode->getUrl())) {
204205
throw new Exception("Cannot share a non-existing file: ".$ajxpNode->getUrl());
205206
}
206-
//$metadata = null;
207207
$newMeta = null;
208208
$maxdownload = abs(intval($this->getFilteredOption("FILE_MAX_DOWNLOAD", $this->repository->getId())));
209209
$download = isset($httpVars["downloadlimit"]) ? abs(intval($httpVars["downloadlimit"])) : 0;

0 commit comments

Comments
 (0)