File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,6 @@ public static function validate(string $token): bool
5454 return true ;
5555 }
5656
57- public static function getHiddenInput (): string
58- {
59- $ token = htmlspecialchars (self ::generate ());
60- return "<input type='hidden' name='csrf_token' value=' $ token'> " ;
61- }
62-
6357 public static function clear (): void
6458 {
6559 if (!isset ($ _SESSION )) {
Original file line number Diff line number Diff line change @@ -328,11 +328,17 @@ public static function clearMessages()
328328 $ _SESSION ["messages " ] = [];
329329 }
330330
331- public static function validateCSRFToken (): void
331+ public static function validatePostCSRFToken (): void
332332 {
333333 $ token = self ::getPostData ("csrf_token " );
334334 if (!CSRFToken::validate ($ token )) {
335335 self ::badRequest ("CSRF token validation failed " , data: ["token " => $ token ]);
336336 }
337337 }
338+
339+ public static function getCSRFTokenHiddenFormInput (): string
340+ {
341+ $ token = htmlspecialchars (CSRFToken::generate ());
342+ return "<input type='hidden' name='csrf_token' value=' $ token'> " ;
343+ }
338344}
You can’t perform that action at this time.
0 commit comments