dot characters, extensions and PHP

Keith Grennan keith at
Tue Aug 1 07:19:53 UTC 2006

Hello all,

Working with OpenID in PHP, I noticed that PHP replaces any dots
in incoming variable names to underscores.

I see that the JanRain code works around the problem by mapping the
underscores back to dots, however I could see this being a nuisance for
extensions.  E.g.:


would appear to a PHP app as:


So the mapping function will have to be more sophisticated - first
replacing all /^openid_/ with 'openid.' (the library does this
currently), then parsing out all the namespace aliases and replacing all
/^openid\.$ns_/ with 'openid.$ns.'.

But it's still possible to construct two legal namespace aliases that
collide for PHP apps.  E.g.:


Also you might have collisions with other OpenID protocol keys that
contain underscores (E.g. namespace aliases like 'user', or 'trust'
could collide with 'openid.trust_root' and 'openid.user_setup_url').

For these reasons it might make sense to say that namespace aliases MUST
NOT contain an underscore, although I know it sucks to make comprimises
for the sake of a particular language's limitations.

In any case this is something to watch out for if you are using OpenID
and PHP.


More information about the yadis mailing list