If I pass request fields or cookies with a period/dot in their names, PHP auto-replaces them with underscores. For example, if I put this code at https://example.com/test.php?x.y=a.b:
<?php echo $_SERVER['REQUEST_URI']; echo $_GET['x.y']; echo $_GET['x_y'];
the output is:
/test.php?x.y=a.b a.b
Is there any way I can prevent this behaviour?
Here’s PHP.net’s explanation of why it does it:
That’s from http://ca.php.net/variables.external.
Also, according to this comment these other characters are converted to underscores:
So it looks like you’re stuck with it, so you’ll have to convert the underscores back to dots in your script using dawnerd’s suggestion (I’d just use str_replace though.)