summaryrefslogtreecommitdiffstats
path: root/Auth/OpenID/Association.php
diff options
context:
space:
mode:
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);
}