We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 48e3795 + 9ad16be commit 5a54e01Copy full SHA for 5a54e01
1 file changed
system/Common.php
@@ -692,9 +692,9 @@ function csrf_hash()
692
*
693
* @return string
694
*/
695
- function csrf_field()
+ function csrf_field(string $id = null)
696
{
697
- return '<input type="hidden" name="' . csrf_token() . '" value="' . csrf_hash() . '">';
+ return '<input type="hidden"' . (!empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . csrf_token() . '" value="' . csrf_hash() . '" />';
698
}
699
700
0 commit comments