@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $filesDropPlugin = new FilesDropPlugin(); |
| 82 | 82 | |
| 83 | 83 | /** @var string $baseuri defined in public.php */ |
| 84 | -$server = $serverFactory->createServer(true, $baseuri, $requestUri, $authPlugin, function (\Sabre\DAV\Server $server) use ($baseuri, $requestUri, $authBackend, $linkCheckPlugin, $filesDropPlugin) { |
|
| 84 | +$server = $serverFactory->createServer(true, $baseuri, $requestUri, $authPlugin, function(\Sabre\DAV\Server $server) use ($baseuri, $requestUri, $authBackend, $linkCheckPlugin, $filesDropPlugin) { |
|
| 85 | 85 | // GET must be allowed for e.g. showing images and allowing Zip downloads |
| 86 | 86 | if ($server->httpRequest->getMethod() !== 'GET') { |
| 87 | 87 | // If this is *not* a GET request we only allow access to public DAV from AJAX or when Server2Server is allowed |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $previousLog = Filesystem::logWarningWhenAddingStorageWrapper(false); |
| 104 | 104 | |
| 105 | 105 | /** @psalm-suppress MissingClosureParamType */ |
| 106 | - Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($requestUri, $baseuri, $share) { |
|
| 106 | + Filesystem::addStorageWrapper('sharePermissions', function($mountPoint, $storage) use ($requestUri, $baseuri, $share) { |
|
| 107 | 107 | $mask = $share->getPermissions() | Constants::PERMISSION_SHARE; |
| 108 | 108 | |
| 109 | 109 | // For chunked uploads it is necessary to have read and delete permission, |
@@ -116,13 +116,13 @@ discard block |
||
| 116 | 116 | }); |
| 117 | 117 | |
| 118 | 118 | /** @psalm-suppress MissingClosureParamType */ |
| 119 | - Filesystem::addStorageWrapper('shareOwner', function ($mountPoint, $storage) use ($share) { |
|
| 119 | + Filesystem::addStorageWrapper('shareOwner', function($mountPoint, $storage) use ($share) { |
|
| 120 | 120 | return new PublicOwnerWrapper(['storage' => $storage, 'owner' => $share->getShareOwner()]); |
| 121 | 121 | }); |
| 122 | 122 | |
| 123 | 123 | // Ensure that also private shares have the `getShare` method |
| 124 | 124 | /** @psalm-suppress MissingClosureParamType */ |
| 125 | - Filesystem::addStorageWrapper('getShare', function ($mountPoint, $storage) use ($share) { |
|
| 125 | + Filesystem::addStorageWrapper('getShare', function($mountPoint, $storage) use ($share) { |
|
| 126 | 126 | return new PublicShareWrapper(['storage' => $storage, 'share' => $share]); |
| 127 | 127 | }, 0); |
| 128 | 128 | |
@@ -145,17 +145,17 @@ discard block |
||
| 145 | 145 | $node->verifyPath($nickname); |
| 146 | 146 | } catch (\Exception $e) { |
| 147 | 147 | // If the path is not valid, we throw an exception |
| 148 | - throw new BadRequest('Invalid nickname: ' . $nickname); |
|
| 148 | + throw new BadRequest('Invalid nickname: '.$nickname); |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Forbid nicknames starting with a dot |
| 152 | 152 | if (str_starts_with($nickname, '.')) { |
| 153 | - throw new BadRequest('Invalid nickname: ' . $nickname); |
|
| 153 | + throw new BadRequest('Invalid nickname: '.$nickname); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // If we have a nickname, let's put |
| 157 | 157 | // all files in the subfolder |
| 158 | - $relativePath = '/' . $nickname . '/' . $relativePath; |
|
| 158 | + $relativePath = '/'.$nickname.'/'.$relativePath; |
|
| 159 | 159 | $relativePath = str_replace('//', '/', $relativePath); |
| 160 | 160 | } |
| 161 | 161 | |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | // Finally handle conflicts on the end files |
| 201 | 201 | $uniqueName = $folder->getNonExistingName(basename($relativePath)); |
| 202 | 202 | $relativePath = substr($folder->getPath(), strlen($node->getPath())); |
| 203 | - $path = '/files/' . $token . '/' . $relativePath . '/' . $uniqueName; |
|
| 204 | - $url = rtrim($request->getBaseUrl(), '/') . str_replace('//', '/', $path); |
|
| 203 | + $path = '/files/'.$token.'/'.$relativePath.'/'.$uniqueName; |
|
| 204 | + $url = rtrim($request->getBaseUrl(), '/').str_replace('//', '/', $path); |
|
| 205 | 205 | if ($isChunkedUpload) { |
| 206 | 206 | $request->setHeader('destination', $url); |
| 207 | 207 | } else { |