Protect against csrf in more places (accounts & guilds pages)

This commit is contained in:
slawkens
2025-05-24 09:52:56 +02:00
parent 72cdd290da
commit 6eda38603c
21 changed files with 43 additions and 4 deletions

View File

@@ -25,8 +25,9 @@ class CsrfToken
*
* @access public
* @static true
* @param bool $return
* @return string
**/
*/
public static function create(bool $return = false): string {
$input = '<input type="hidden" name="csrf_token" value="' . self::get() . '" />';
if ($return) {
@@ -58,7 +59,7 @@ class CsrfToken
* @static true
* @return boolean
**/
public static function isValid($post): bool
public static function isValid(string|null $post): bool
{
if (!setting('core.csrf_protection')) {
return true;