diff options
-rw-r--r-- | Auth/OpenID/Consumer/Consumer.php | 30 | ||||
-rw-r--r-- | Auth/OpenID/Consumer/Parse.php | 12 | ||||
-rw-r--r-- | Auth/OpenID/Util.php | 4 |
3 files changed, 23 insertions, 23 deletions
diff --git a/Auth/OpenID/Consumer/Consumer.php b/Auth/OpenID/Consumer/Consumer.php index bdabeca..170c646 100644 --- a/Auth/OpenID/Consumer/Consumer.php +++ b/Auth/OpenID/Consumer/Consumer.php @@ -494,13 +494,13 @@ class Auth_OpenID_Consumer { { $query = Auth_OpenID_fixArgs($query); - $mode = Auth_OpenID_array_get($query, 'openid.mode', ''); + $mode = Auth_OpenID_arrayGet($query, 'openid.mode', ''); if ($mode == 'cancel') { return array(Auth_OpenID_SUCCESS, null); } else if ($mode == 'error') { - $error = Auth_OpenID_array_get($query, 'openid.error', null); + $error = Auth_OpenID_arrayGet($query, 'openid.error', null); if ($error !== null) { trigger_error("In OpenID completeAuth: $error", E_USER_NOTICE); @@ -544,9 +544,9 @@ class Auth_OpenID_Consumer { list($nonce, $consumer_id, $server_id, $server_url) = $ret; - $return_to = Auth_OpenID_array_get($query, 'openid.return_to', null); - $server_id2 = Auth_OpenID_array_get($query, 'openid.identity', null); - $assoc_handle = Auth_OpenID_array_get($query, + $return_to = Auth_OpenID_arrayGet($query, 'openid.return_to', null); + $server_id2 = Auth_OpenID_arrayGet($query, 'openid.identity', null); + $assoc_handle = Auth_OpenID_arrayGet($query, 'openid.assoc_handle', null); if (($return_to === null) || @@ -559,7 +559,7 @@ class Auth_OpenID_Consumer { return array(Auth_OpenID_FAILURE, $consumer_id); } - $user_setup_url = Auth_OpenID_array_get($query, + $user_setup_url = Auth_OpenID_arrayGet($query, 'openid.user_setup_url', null); if ($user_setup_url !== null) { @@ -578,8 +578,8 @@ class Auth_OpenID_Consumer { } // Check the signature - $sig = Auth_OpenID_array_get($query, 'openid.sig', null); - $signed = Auth_OpenID_array_get($query, 'openid.signed', null); + $sig = Auth_OpenID_arrayGet($query, 'openid.sig', null); + $signed = Auth_OpenID_arrayGet($query, 'openid.signed', null); if (($sig === null) || ($signed === null)) { return array(Auth_OpenID_FAILURE, $consumer_id); @@ -604,7 +604,7 @@ class Auth_OpenID_Consumer { */ function _checkAuth($nonce, $query, $server_url) { - $signed = Auth_OpenID_array_get($query, 'openid.signed', null); + $signed = Auth_OpenID_arrayGet($query, 'openid.signed', null); if ($signed === null) { return Auth_OpenID_FAILURE; } @@ -631,10 +631,10 @@ class Auth_OpenID_Consumer { } $results = Auth_OpenID_kvToArray($ret[2]); - $is_valid = Auth_OpenID_array_get($results, 'is_valid', 'false'); + $is_valid = Auth_OpenID_arrayGet($results, 'is_valid', 'false'); if ($is_valid == 'true') { - $invalidate_handle = Auth_OpenID_array_get($results, + $invalidate_handle = Auth_OpenID_arrayGet($results, 'invalidate_handle', null); if ($invalidate_handle !== null) { @@ -649,7 +649,7 @@ class Auth_OpenID_Consumer { return Auth_OpenID_SUCCESS; } - $error = Auth_OpenID_array_get($results, 'error', null); + $error = Auth_OpenID_arrayGet($results, 'error', null); if ($error !== null) { $msg = sprintf("Error message from server during " . "check_authentication: %s", $error); @@ -817,7 +817,7 @@ class Auth_OpenID_Consumer { list($http_code, $url, $data) = $ret; $results = Auth_OpenID_kvToArray($data); if ($http_code == 400) { - $error = Auth_OpenID_array_get($results, 'error', + $error = Auth_OpenID_arrayGet($results, 'error', '<no message from server>'); $fmt = 'Getting association: error returned from server %s: %s'; @@ -861,10 +861,10 @@ class Auth_OpenID_Consumer { } $assoc_handle = $results['assoc_handle']; - $expires_in = intval(Auth_OpenID_array_get($results, 'expires_in', + $expires_in = intval(Auth_OpenID_arrayGet($results, 'expires_in', '0')); - $session_type = Auth_OpenID_array_get($results, 'session_type', null); + $session_type = Auth_OpenID_arrayGet($results, 'session_type', null); if ($session_type === null) { $secret = base64_decode($results['mac_key']); } else { diff --git a/Auth/OpenID/Consumer/Parse.php b/Auth/OpenID/Consumer/Parse.php index 389e5d5..e63e03e 100644 --- a/Auth/OpenID/Consumer/Parse.php +++ b/Auth/OpenID/Consumer/Parse.php @@ -118,12 +118,12 @@ function Auth_OpenID_tagMatcher($tag_name, $close_tags = null) return sprintf("/%s/%s", $expr, $_Auth_OpenID_re_flags); } -function Auth_OpenID_html_find() +function Auth_OpenID_htmlFind() { return Auth_OpenID_tagMatcher('html'); } -function Auth_OpenID_head_find() +function Auth_OpenID_headFind() { return Auth_OpenID_tagMatcher('head', array('body')); } @@ -196,14 +196,14 @@ function Auth_OpenID_parseLinkAttrs($html) $html); // Try to find the <HTML> tag. - $html_re = Auth_OpenID_html_find(); + $html_re = Auth_OpenID_htmlFind(); $html_matches = array(); if (!preg_match($html_re, $stripped, $html_matches)) { return array(); } // Try to find the <HEAD> tag. - $head_re = Auth_OpenID_head_find(); + $head_re = Auth_OpenID_headFind(); $head_matches = array(); if (!preg_match($head_re, $html_matches[0], $head_matches)) { return array(); @@ -254,7 +254,7 @@ function Auth_OpenID_linkHasRel($link_attrs, $target_rel) { // Does this link have target_rel as a relationship? // XXX: TESTME - $rel_attr = Auth_OpenID_array_get($link_attrs, 'rel', null); + $rel_attr = Auth_OpenID_arrayGet($link_attrs, 'rel', null); return ($rel_attr && Auth_OpenID_relMatches($rel_attr, $target_rel)); } @@ -283,7 +283,7 @@ function Auth_OpenID_findFirstHref($link_attrs_list, $target_rel) return null; } $first = $matches[0]; - return Auth_OpenID_array_get($first, 'href', null); + return Auth_OpenID_arrayGet($first, 'href', null); } ?>
\ No newline at end of file diff --git a/Auth/OpenID/Util.php b/Auth/OpenID/Util.php index 4571101..67ba691 100644 --- a/Auth/OpenID/Util.php +++ b/Auth/OpenID/Util.php @@ -45,7 +45,7 @@ function Auth_OpenID_ensureDir($dir_name) * * @access private */ -function Auth_OpenID_array_get($arr, $key, $fallback = null) +function Auth_OpenID_arrayGet($arr, $key, $fallback = null) { if (is_array($arr)) { if (array_key_exists($key, $arr)) { @@ -54,7 +54,7 @@ function Auth_OpenID_array_get($arr, $key, $fallback = null) return $fallback; } } else { - trigger_error("Auth_OpenID_array_get expected " . + trigger_error("Auth_OpenID_arrayGet expected " . "array as first parameter", E_USER_WARNING); return false; } |