]> source.dussan.org Git - nextcloud-server.git/commitdiff
refactor(comments): Replace security annotations with respective attributes 46745/head
authorprovokateurin <kate@provokateurin.de>
Thu, 25 Jul 2024 11:14:45 +0000 (13:14 +0200)
committerprovokateurin <kate@provokateurin.de>
Thu, 25 Jul 2024 11:14:45 +0000 (13:14 +0200)
Signed-off-by: provokateurin <kate@provokateurin.de>
apps/comments/lib/Controller/NotificationsController.php

index 408efc4697379288aec0beec9f14d0e8a33dd046..a3228247884ae5a5ae219d5bf8789e9b245f1073 100644 (file)
@@ -7,7 +7,9 @@ namespace OCA\Comments\Controller;
 
 use OCP\AppFramework\Controller;
 use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
 use OCP\AppFramework\Http\Attribute\OpenAPI;
+use OCP\AppFramework\Http\Attribute\PublicPage;
 use OCP\AppFramework\Http\NotFoundResponse;
 use OCP\AppFramework\Http\RedirectResponse;
 use OCP\Comments\IComment;
@@ -37,9 +39,6 @@ class NotificationsController extends Controller {
        }
 
        /**
-        * @PublicPage
-        * @NoCSRFRequired
-        *
         * View a notification
         *
         * @param string $id ID of the notification
@@ -49,6 +48,8 @@ class NotificationsController extends Controller {
         * 303: Redirected to notification
         * 404: Notification not found
         */
+       #[PublicPage]
+       #[NoCSRFRequired]
        public function view(string $id): RedirectResponse|NotFoundResponse {
                $currentUser = $this->userSession->getUser();
                if (!$currentUser instanceof IUser) {