Req #60219 [Com]: POSTDATA periods (.) being converted to underscores (_)

From: Date: Fri, 28 May 2021 18:11:26 +0000
Subject: Req #60219 [Com]: POSTDATA periods (.) being converted to underscores (_)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234084@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60219&edit=1 ID: 60219 Comment by: ggggh dot fggg at fghb dot cf Reported by: kieran at menor dot dk Summary: POSTDATA periods (.) being converted to underscores (_) Status: Open Type: Feature/Change Request Package: Unknown/Other Function PHP Version: Irrelevant Block user comment: N Private report: N New Comment: and why can't you just not use a-z and underlines like every normal human being does for variable names? Previous Comments: ------------------------------------------------------------------------ [2021-05-28 18:06:18] nospam at unclassified dot de I just ran into this as well. I set a cookie with setcookie() and it just wasn't read anymore. Firefox showed it to me but PHP was just blind. Dumping $_COOKIE showed me another cookie with an underscore where I had put a dot. PHP still does that crap from the last century. Doesn't seem like anybody at the PHP team cares about doing things right for once. How typical. I guess PHP remains a hacky language forever, not suitable for serious work. PS: Voting is broken in this bug tracker, too. I voted and got an empty page. Probably an unhandled server error, due to some weirdness of the PHP language. ------------------------------------------------------------------------ [2012-01-23 22:32:42] tim at xi dot co dot nz See: https://wiki.php.net/rfc/url_dots ------------------------------------------------------------------------ [2012-01-23 20:08:33] kcerny at wirelesscapital dot com The relevant code is found in the source file main/php_variables.c at line 94: /* ensure that we don't have spaces or dots in the variable name (not binary safe) */ for (p = var; *p; p++) { if (*p == ' ' || *p == '.') { *p='_'; } else if (*p == '[') { is_array = 1; ip = p; *p = 0; break; } } I'm not sure what repercussions we'll face by removing that first if statement. I would suggest controlling this replacement behavior using an INI setting for backwards compatibility. ------------------------------------------------------------------------ [2011-11-15 04:20:32] pablitobof at yahoo dot com dot mx PHP 5.4 alpha1 has just been released which removes register_globals. It seems appropriate that there would be a matching move towards removing the now unnecessary translation of characters in requests. ------------------------------------------------------------------------ [2011-11-04 14:10:02] kieran at menor dot dk Not to mention, it's also potentially confusing and unexpected behavior for people who didn't happen to read that tiny paragraph of the manual. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=60219 -- Edit this bug report at https://bugs.php.net/bug.php?id=60219&edit=1

« previous php.bugs (#234084) next »