diff options
author | Will Norris <will@willnorris.com> | 2009-05-28 12:59:52 +0800 |
---|---|---|
committer | Will Norris <will@willnorris.com> | 2009-05-28 13:01:54 +0800 |
commit | 625f0d1b7a32d46ee29129fddc4cc7cf645e5aa8 (patch) | |
tree | cb5782ec5e51feedf3d01f2967083918547a7aac /Auth | |
parent | d90728f6b8c63ee2d8957bf47d09c76802cf743c (diff) | |
download | php-openid-625f0d1b7a32d46ee29129fddc4cc7cf645e5aa8.zip php-openid-625f0d1b7a32d46ee29129fddc4cc7cf645e5aa8.tar.gz php-openid-625f0d1b7a32d46ee29129fddc4cc7cf645e5aa8.tar.bz2 |
still use in_array, just require strict type checking
Signed-off-by: Will Norris <will@willnorris.com>
Diffstat (limited to 'Auth')
-rw-r--r-- | Auth/OpenID/Association.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php index 6a3a11b..07aaee1 100644 --- a/Auth/OpenID/Association.php +++ b/Auth/OpenID/Association.php @@ -131,10 +131,8 @@ class Auth_OpenID_Association { function Auth_OpenID_Association( $handle, $secret, $issued, $lifetime, $assoc_type) { - // 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)) { + if (!in_array($assoc_type, + Auth_OpenID_getSupportedAssociationTypes(), true)) { $fmt = 'Unsupported association type (%s)'; trigger_error(sprintf($fmt, $assoc_type), E_USER_ERROR); } |