diff options
author | tailor <cygnus@janrain.com> | 2006-04-19 19:40:17 +0000 |
---|---|---|
committer | tailor <cygnus@janrain.com> | 2006-04-19 19:40:17 +0000 |
commit | 4cb1c79600ea5d6d977c487c78195c06e20652b2 (patch) | |
tree | e9b86761f5f180596b12822ae93a3c9723469fe1 | |
parent | 7128a78b0e433bb8ff985b684f11c473cf28aeaa (diff) | |
download | php-openid-4cb1c79600ea5d6d977c487c78195c06e20652b2.zip php-openid-4cb1c79600ea5d6d977c487c78195c06e20652b2.tar.gz php-openid-4cb1c79600ea5d6d977c487c78195c06e20652b2.tar.bz2 |
[project @ Fixed sorting bugs in KVForm and association code]
-rw-r--r-- | Auth/OpenID/Association.php | 14 | ||||
-rw-r--r-- | Auth/OpenID/KVForm.php | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php index a520142..3fa0b6f 100644 --- a/Auth/OpenID/Association.php +++ b/Auth/OpenID/Association.php @@ -89,7 +89,7 @@ class Auth_OpenID_Association { $issued = time(); $lifetime = $expires_in; return new Auth_OpenID_Association($handle, $secret, - $issued, $lifetime, $assoc_type); + $issued, $lifetime, $assoc_type); } /** @@ -210,14 +210,22 @@ class Auth_OpenID_Association { $class_vars = get_class_vars($class_name); $class_assoc_keys = $class_vars['assoc_keys']; + + sort($keys); + sort($class_assoc_keys); + if ($keys != $class_assoc_keys) { trigger_error('Unexpected key values: ' . strval($keys), E_USER_WARNING); return null; } - list($version, $handle, $secret, $issued, $lifetime, $assoc_type) = - $values; + $version = $pairs['version']; + $handle = $pairs['handle']; + $secret = $pairs['secret']; + $issued = $pairs['issued']; + $lifetime = $pairs['lifetime']; + $assoc_type = $pairs['assoc_type']; if ($version != '2') { trigger_error('Unknown version: ' . $version, E_USER_WARNING); diff --git a/Auth/OpenID/KVForm.php b/Auth/OpenID/KVForm.php index c7be515..f021035 100644 --- a/Auth/OpenID/KVForm.php +++ b/Auth/OpenID/KVForm.php @@ -105,6 +105,8 @@ class Auth_OpenID_KVForm { return null; } + ksort($values); + $serialized = ''; foreach ($values as $key => $value) { if (is_array($value)) { |