Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why this strange symbol in hidden element

I've seen a form that has the following hidden elements. The first one is obviously a security token for CSRF, but what's the second one. It's more or less an image. What added security would it give me? and how do I generate one?

<input type="hidden" value="G2k2DNFer3z2NR0zYO" name="key">
<input type="hidden" value="☃" name="_face">
<input type="hidden" value="home" name="ref_source">
like image 352
samquo Avatar asked Jan 26 '11 08:01

samquo


1 Answers

That SNOWMAN is actually a character in Unicode (U+2603) and it is probably used to test whether the client uses a proper character encoding (probably UTF-8) or not, for example:

$isUtf8 = $_POST['_face'] === "\xE2\x98\x83";
like image 179
Gumbo Avatar answered Oct 19 '22 12:10

Gumbo