diff options
Diffstat (limited to 'Auth')
-rw-r--r-- | Auth/OpenID/Nonce.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Auth/OpenID/Nonce.php b/Auth/OpenID/Nonce.php index 25e3638..1d05dd8 100644 --- a/Auth/OpenID/Nonce.php +++ b/Auth/OpenID/Nonce.php @@ -96,7 +96,11 @@ function Auth_OpenID_mkNonce($when = null) $salt = Auth_OpenID_CryptUtil::randomString( 6, Auth_OpenID_Nonce_CHRS); if ($when === null) { - $when = gmmktime(); + // It's safe to call mktime() with no arguments; it returns a + // GMT unix timestamp on PHP 4 and PHP 5. gmmktime() with no + // args returns a local unix timestamp on PHP 4, so don't use + // that. + $when = mktime(); } $time_str = gmstrftime(Auth_OpenID_Nonce_TIME_FMT, $when); return $time_str . $salt; |