Browse Source

Fix public link user relative (#170)

* Fixes #164 Don't allow relative save if it's a public link

* Fix "no name for guest user"

Check if editor is equal to null, not ''
master^2
Pranav Kant 1 year ago
parent
commit
327dd432ad
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      lib/Controller/WopiController.php

+ 3
- 3
lib/Controller/WopiController.php View File

@@ -114,13 +114,13 @@ class WopiController extends Controller {
'BaseFileName' => $file->getName(),
'Size' => $file->getSize(),
'Version' => $version,
'UserId' => $res['editor'] !== '' ? $res['editor'] : 'Guest user',
'UserId' => !is_null($res['editor']) ? $res['editor'] : 'guest',
'OwnerId' => $res['owner'],
'UserFriendlyName' => $res['editor'] !== '' ? \OC_User::getDisplayName($res['editor']) : 'Guest user',
'UserFriendlyName' => !is_null($res['editor']) ? \OC_User::getDisplayName($res['editor']) : 'Guest user',
'UserExtraInfo' => [
],
'UserCanWrite' => $res['canwrite'] ? true : false,
'UserCanNotWriteRelative' => \OC::$server->getEncryptionManager()->isEnabled() ? true : false,
'UserCanNotWriteRelative' => \OC::$server->getEncryptionManager()->isEnabled() ? true : is_null($res['editor']),
'PostMessageOrigin' => $res['server_host'],
'LastModifiedTime' => Helper::toISO8601($file->getMtime())
];

Loading…
Cancel
Save