Skip to content

Commit e7e3f09

Browse files
committed
fix: code cleanups
Signed-off-by: codewithvk <[email protected]>
1 parent a01da14 commit e7e3f09

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

lib/Controller/DocumentController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,6 @@ public function editOnlineTarget(int $fileId, ?string $target = null): RedirectR
385385
#[PublicPage]
386386
public function token(int $fileId, ?string $shareToken = null, ?string $path = null, ?string $guestName = null): DataResponse {
387387
try {
388-
// Normal file handling (unchanged)
389388
$share = $shareToken ? $this->shareManager->getShareByToken($shareToken) : null;
390389
$file = $shareToken ? $this->getFileForShare($share, $fileId, $path) : $this->getFileForUser($fileId, $path);
391390

lib/Controller/SettingsController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public function demoServers(): DataResponse {
101101
public function getSettings(): JSONResponse {
102102
return new JSONResponse($this->getSettingsData());
103103
}
104-
// TODO : Provide Auth tokens here :)
105104
private function getSettingsData(): array {
106105
return [
107106
'wopi_url' => $this->appConfig->getCollaboraUrlInternal(),

lib/Controller/WopiController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ public function __construct(
103103
#[FrontpageRoute(verb: 'GET', url: 'wopi/files/{fileId}')]
104104
public function checkFileInfo(string $fileId, string $access_token): JSONResponse {
105105
try {
106-
$wopi = $this->wopiMapper->getWopiForToken($access_token);
107-
108106
[$fileId, , $version] = Helper::parseFileId($fileId);
107+
108+
$wopi = $this->wopiMapper->getWopiForToken($access_token);
109109
$file = $this->getFileForWopiToken($wopi);
110110
if (!($file instanceof File)) {
111111
throw new NotFoundException('No valid file found for ' . $fileId);

lib/TokenManager.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,11 @@ public function __construct(
4848
* @throws Exception
4949
*/
5050
public function generateWopiToken(string $fileId, ?string $shareToken = null, ?string $editoruid = null, bool $direct = false): Wopi {
51-
51+
[$fileId, , $version] = Helper::parseFileId($fileId);
5252
$owneruid = null;
5353
$hideDownload = false;
5454
$rootFolder = $this->rootFolder;
5555

56-
[$fileId, , $version] = Helper::parseFileId($fileId);
57-
5856
// if the user is not logged-in do use the sharers storage
5957
if ($shareToken !== null) {
6058
/** @var File $file */

0 commit comments

Comments
 (0)