Annoying issue with PHP $_GET replacing the dots in variable names
The PHP replaces certain characters (among which dots, spaces, and square brakets) in the $_GET field names.
Personally I am strongly against pre-processing such information without a strong ground. The ground, the same with the well-known magic quotes workaround is to ameliorate the developer's life in using the parameters in a safer and easier way.
However, the effect is that in order to use any kind of variable name the developer needs to patch the patch.
The idea is that before using the $_GET variables they have to be corrected:
- clear the old keys;
- replace them with the correct key.
But now, another issue appeared in the PHP LightOpenID implementation, where the constructor strongly relies on this workaround.
Also this had to be fixed now.
{// Fix because $_GET replaces var name ., underscore, space, etc. to "_" FIX:F1301041743
foreach($_GET as $k=>$v)
unset($_GET[$k]);
$get=explode('&',$_SERVER['QUERY_STRING']);
foreach($get as $kv){
if(!@strlen($kv))
continue;
$kv=explode('=',$kv);
$k=urldecode($kv[0]);
$v=@urldecode($kv[1]);
$_GET[$k]=$v;
}
}//EOFIX:F1301041743