summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-01-04 00:09:39 +0000
committertailor <cygnus@janrain.com>2007-01-04 00:09:39 +0000
commit86cd7e408cfb1361a1a402e21c0b8c0d0ef03d95 (patch)
treebcbb6f5ff922aa3e556c3a065e7bad4dbf960fc3
parent9fc9dc4359b3123adbc2ee7e2fccfa085242edcb (diff)
downloadphp-openid-86cd7e408cfb1361a1a402e21c0b8c0d0ef03d95.zip
php-openid-86cd7e408cfb1361a1a402e21c0b8c0d0ef03d95.tar.gz
php-openid-86cd7e408cfb1361a1a402e21c0b8c0d0ef03d95.tar.bz2
[project @ FIX #1150: Move OpenID namespaces into Auth_OpenID class]
-rw-r--r--Auth/OpenID.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/Auth/OpenID.php b/Auth/OpenID.php
index a56835a..e932f5e 100644
--- a/Auth/OpenID.php
+++ b/Auth/OpenID.php
@@ -96,14 +96,6 @@ 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
@@ -112,6 +104,16 @@ $_Auth_OpenID_namespaces = array('openid',
class Auth_OpenID {
/**
+ * These namespaces are automatically fixed in query arguments by
+ * Auth_OpenID::fixArgs.
+ */
+ function getOpenIDNamespaces()
+ {
+ return array('openid',
+ 'sreg');
+ }
+
+ /**
* Rename query arguments back to 'openid.' from 'openid_'
*
* @access private
@@ -119,11 +121,10 @@ class Auth_OpenID {
*/
function fixArgs($args)
{
- global $_Auth_OpenID_namespaces;
foreach (array_keys($args) as $key) {
$fixed = $key;
if (preg_match('/^openid/', $key)) {
- foreach ($_Auth_OpenID_namespaces as $ns) {
+ foreach (Auth_OpenID::getOpenIDNamespaces() as $ns) {
if (preg_match('/'.$ns.'_/', $key)) {
$fixed = preg_replace('/'.$ns.'_/', $ns.'.', $fixed);
}