summaryrefslogtreecommitdiffstats
path: root/Auth
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-05-15 19:04:43 +0000
committertailor <cygnus@janrain.com>2006-05-15 19:04:43 +0000
commit6b6029c88cfd29a874dba6be19b123c440265e16 (patch)
tree578322fb906fbb598ee6c4ec43c4a139cc59d1f0 /Auth
parent93cc8afe0246e4db5e79849450a892e2f7e3e8aa (diff)
downloadphp-openid-6b6029c88cfd29a874dba6be19b123c440265e16.zip
php-openid-6b6029c88cfd29a874dba6be19b123c440265e16.tar.gz
php-openid-6b6029c88cfd29a874dba6be19b123c440265e16.tar.bz2
[project @ BUGFIX: fixed handling of query args for sreg-namespaced values]
Diffstat (limited to 'Auth')
-rw-r--r--Auth/OpenID.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/Auth/OpenID.php b/Auth/OpenID.php
index b80d9da..b52d41b 100644
--- a/Auth/OpenID.php
+++ b/Auth/OpenID.php
@@ -96,6 +96,14 @@ define('Auth_OpenID_punct',
"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");
/**
+ * These namespaces are automatically fixed in query arguments by
+ * Auth_OpenID::fixArgs.
+ */
+global $_Auth_OpenID_namespaces;
+$_Auth_OpenID_namespaces = array('openid',
+ 'sreg');
+
+/**
* The OpenID utility function class.
*
* @package OpenID
@@ -126,8 +134,15 @@ class Auth_OpenID {
*/
function fixArgs($args)
{
+ global $_Auth_OpenID_namespaces;
foreach (array_keys($args) as $key) {
- $fixed = preg_replace('/^openid_/', 'openid.', $key);
+ $fixed = $key;
+ foreach ($_Auth_OpenID_namespaces as $ns) {
+ if (preg_match('/'.$ns.'_/', $key)) {
+ $fixed = preg_replace('/'.$ns.'_/', $ns.'.', $fixed);
+ }
+ }
+
if ($fixed != $key) {
$val = $args[$key];
unset($args[$key]);