summaryrefslogtreecommitdiffstats
path: root/Auth/OpenID/Association.php
diff options
context:
space:
mode:
authorLuke Shepard <lshepard@devrs006.snc1.facebook.com>2009-05-28 07:08:30 +0800
committerWill Norris <will@willnorris.com>2009-05-28 13:01:42 +0800
commitd90728f6b8c63ee2d8957bf47d09c76802cf743c (patch)
tree02306114d09d508282469ea316992001d0031bb2 /Auth/OpenID/Association.php
parent164375f493ea7de083ee64d25137b276f45ef172 (diff)
downloadphp-openid-d90728f6b8c63ee2d8957bf47d09c76802cf743c.zip
php-openid-d90728f6b8c63ee2d8957bf47d09c76802cf743c.tar.gz
php-openid-d90728f6b8c63ee2d8957bf47d09c76802cf743c.tar.bz2
[ few random cleanup changes ]
A few minor changes made over the past few months. This adds some additional logging, an extra helper function for error messages, and fixes a small bug with the association handler ... not to mention standardizing on "false" instead of "False". Signed-off-by: Will Norris <will@willnorris.com>
Diffstat (limited to 'Auth/OpenID/Association.php')
-rw-r--r--Auth/OpenID/Association.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php
index 2cd74e5..6a3a11b 100644
--- a/Auth/OpenID/Association.php
+++ b/Auth/OpenID/Association.php
@@ -131,8 +131,10 @@ class Auth_OpenID_Association {
function Auth_OpenID_Association(
$handle, $secret, $issued, $lifetime, $assoc_type)
{
- if (!in_array($assoc_type,
- Auth_OpenID_getSupportedAssociationTypes())) {
+ // use array_key_exists because in_array doesn't check
+ // correctly for numerical indexes
+ $types_hash = array_flip(Auth_OpenID_getSupportedAssociationTypes());
+ if (!array_key_exists($assoc_type, $types_hash)) {
$fmt = 'Unsupported association type (%s)';
trigger_error(sprintf($fmt, $assoc_type), E_USER_ERROR);
}