diff options
author | provokateurin <kate@provokateurin.de> | 2024-07-25 13:24:59 +0200 |
---|---|---|
committer | provokateurin <kate@provokateurin.de> | 2024-07-26 07:30:45 +0200 |
commit | c57c3c15734c153d541247cc5fca198cb0e4f7b6 (patch) | |
tree | 2cccda08d45230601f8bb5f1e74b74195d826692 /core/Controller/PreviewController.php | |
parent | 41f7fa6840a13cb2cb1c9d4ac1d3eca6012e22de (diff) | |
download | nextcloud-server-c57c3c15734c153d541247cc5fca198cb0e4f7b6.tar.gz nextcloud-server-c57c3c15734c153d541247cc5fca198cb0e4f7b6.zip |
refactor(core): Replace security annotations with respective attributes
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'core/Controller/PreviewController.php')
-rw-r--r-- | core/Controller/PreviewController.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php index 4ace295a6aa..a3b826c19e6 100644 --- a/core/Controller/PreviewController.php +++ b/core/Controller/PreviewController.php @@ -12,6 +12,8 @@ use OCA\Files_Sharing\SharedStorage; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\Attribute\FrontpageRoute; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; +use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\FileDisplayResponse; use OCP\AppFramework\Http\RedirectResponse; @@ -36,9 +38,6 @@ class PreviewController extends Controller { } /** - * @NoAdminRequired - * @NoCSRFRequired - * * Get a preview by file path * * @param string $file Path of the file @@ -56,6 +55,8 @@ class PreviewController extends Controller { * 403: Getting preview is not allowed * 404: Preview not found */ + #[NoAdminRequired] + #[NoCSRFRequired] #[FrontpageRoute(verb: 'GET', url: '/core/preview.png')] public function getPreview( string $file = '', @@ -80,9 +81,6 @@ class PreviewController extends Controller { } /** - * @NoAdminRequired - * @NoCSRFRequired - * * Get a preview by file ID * * @param int $fileId ID of the file @@ -100,6 +98,8 @@ class PreviewController extends Controller { * 403: Getting preview is not allowed * 404: Preview not found */ + #[NoAdminRequired] + #[NoCSRFRequired] #[FrontpageRoute(verb: 'GET', url: '/core/preview')] public function getPreviewByFileId( int $fileId = -1, |