--- /dev/null
+<?php
+
+namespace wcf\http\attribute;
+
+/**
+ * Disables the built-in XSRF validation of PSR-15 controllers.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2022 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\Http\Attribute
+ * @since 6.0
+ */
+#[\Attribute(\Attribute::TARGET_CLASS)]
+final class DisableXsrfCheck
+{
+}
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
+use wcf\http\attribute\DisableXsrfCheck;
use wcf\system\exception\InvalidSecurityTokenException;
use wcf\system\request\Request;
use wcf\system\request\RequestHandler;
}
$reflectionClass = new \ReflectionClass($request->getClassName());
- if ($reflectionClass->getAttributes('DisableXsrfCheck') !== []) {
+ if ($reflectionClass->getAttributes(DisableXsrfCheck::class) !== []) {
// Controller has opted out of the XSRF check.
return;
}
}
}
}
-
-#[\Attribute(\Attribute::TARGET_CLASS)]
-final class DisableXsrfCheck
-{
-}