Created
March 28, 2024 13:11
-
-
Save markkimsal/7b73233301c701c9d53c06d4174ef37d to your computer and use it in GitHub Desktop.
Laravel CSRF Breach mitigation (?)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function csrf_field() | |
{ | |
return new HtmlString('<input type="hidden" name="_token" value="'.csrf_token().'" autocomplete="off" data-rand="'.substr(str_shuffle(md5(microtime())), 0, rand(0, 100)).'">'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment