Skip to content

Commit 41a548d

Browse files
committed
chore: support Nextcloud 34
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
1 parent 0370499 commit 41a548d

6 files changed

Lines changed: 19 additions & 4 deletions

File tree

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The official whiteboard app for Nextcloud. It allows users to create and share w
4040
<screenshot>https://raw.githubusercontent.com/nextcloud/whiteboard/main/screenshots/screenshot1.png</screenshot>
4141

4242
<dependencies>
43-
<nextcloud min-version="28" max-version="33"/>
43+
<nextcloud min-version="28" max-version="34"/>
4444
</dependencies>
4545

4646
<settings>

lib/Controller/RecordingController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ private function initializeRecordingState(int $fileId, string $jwt): void {
163163

164164
private function createRecordingResponse(): PublicTemplateResponse {
165165
$csp = new ContentSecurityPolicy();
166-
$csp->allowEvalScript();
166+
// NC34 removed allowEvalScript(), but the recording bundle still needs unsafe-eval.
167+
$csp->addAllowedScriptDomain('\'unsafe-eval\'');
167168

168169
$response = new PublicTemplateResponse($this->appName, 'recording');
169170
$response->setFooterVisible();

lib/Service/File/GetFileFromPublicSharingTokenService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use InvalidArgumentException;
1313
use OCP\Constants;
1414
use OCP\Files\File;
15+
use OCP\Files\Folder;
1516
use OCP\Files\NotFoundException;
1617
use OCP\Share\Exceptions\ShareNotFound;
1718
use OCP\Share\IManager as ShareManager;
@@ -51,6 +52,10 @@ public function getFile(): File {
5152
return $node;
5253
}
5354

55+
if (!$node instanceof Folder) {
56+
throw new InvalidArgumentException('No proper share data');
57+
}
58+
5459
$node = $node->getFirstNodeById($this->fileId);
5560

5661
if ($node instanceof File) {

lib/Settings/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function getForm(): TemplateResponse {
3232
'whiteboard',
3333
'admin',
3434
[],
35-
'blank'
35+
TemplateResponse::RENDER_AS_BLANK
3636
);
3737
$csp = new ContentSecurityPolicy();
3838
$csp->addAllowedConnectDomain('*');

lib/Settings/Personal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getForm(): TemplateResponse {
3737
'whiteboard',
3838
'personal',
3939
[],
40-
'blank'
40+
TemplateResponse::RENDER_AS_BLANK
4141
);
4242
$csp = new ContentSecurityPolicy();
4343
$csp->addAllowedConnectDomain('*');

playwright/e2e/version-preview.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ const versionPropfindBody = `<?xml version="1.0"?>
2424
</d:prop>
2525
</d:propfind>`
2626

27+
const skipWhenVersionContentUnavailable = () => {
28+
test.skip(
29+
process.env.SERVER_VERSION === 'stable29',
30+
'Nextcloud 29 does not expose version content over the versions DAV endpoint',
31+
)
32+
}
33+
2734
const extractVersionIds = (xml: string, userId: string, fileId: number | string): string[] => {
2835
const prefix = `/remote.php/dav/versions/${userId}/versions/${fileId}/`
2936
const hrefRegex = /<[^:>]*:href>([^<]+)<\/[^:>]*:href>/g
@@ -189,6 +196,7 @@ test('version preview banner shows and exits to live board', async ({
189196
page,
190197
user,
191198
}) => {
199+
skipWhenVersionContentUnavailable()
192200
test.setTimeout(120000)
193201
const boardName = `Version preview ${Date.now()}`
194202
const initialText = 'Version one'
@@ -223,6 +231,7 @@ test('restore version replaces current content', async ({
223231
page,
224232
user,
225233
}) => {
234+
skipWhenVersionContentUnavailable()
226235
test.setTimeout(120000)
227236
const boardName = `Version restore ${Date.now()}`
228237
const initialText = 'Restore one'

0 commit comments

Comments
 (0)