diff options
author | tailor <cygnus@cprogrammer.org> | 2007-11-26 19:56:28 +0000 |
---|---|---|
committer | tailor <cygnus@cprogrammer.org> | 2007-11-26 19:56:28 +0000 |
commit | 691ad461b09f249f2cbd4614c68576ebb303ea2f (patch) | |
tree | 994e94ca0199f583ee5c2a8168e53c8e8ab2276d /Auth | |
parent | 8d6f82a082e79462bfa1a4026479fbf38bcfc576 (diff) | |
download | php-openid-691ad461b09f249f2cbd4614c68576ebb303ea2f.zip php-openid-691ad461b09f249f2cbd4614c68576ebb303ea2f.tar.gz php-openid-691ad461b09f249f2cbd4614c68576ebb303ea2f.tar.bz2 |
[project @ [FIX #38] Replace direct usage of NO_MATH_SUPPORT with function calls]
Diffstat (limited to 'Auth')
-rw-r--r-- | Auth/OpenID.php | 4 | ||||
-rw-r--r-- | Auth/OpenID/Association.php | 2 | ||||
-rw-r--r-- | Auth/OpenID/BigMath.php | 16 |
3 files changed, 17 insertions, 5 deletions
diff --git a/Auth/OpenID.php b/Auth/OpenID.php index fd72db3..a1a0d43 100644 --- a/Auth/OpenID.php +++ b/Auth/OpenID.php @@ -97,7 +97,7 @@ define('Auth_OpenID_punct', "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"); if (Auth_OpenID_getMathLib() === null) { - define('Auth_OpenID_NO_MATH_SUPPORT', true); + Auth_OpenID_setNoMathSupport(); } /** @@ -574,4 +574,4 @@ class Auth_OpenID { } } } -?>
\ No newline at end of file +?> diff --git a/Auth/OpenID/Association.php b/Auth/OpenID/Association.php index 1bfe403..4d3ac33 100644 --- a/Auth/OpenID/Association.php +++ b/Auth/OpenID/Association.php @@ -423,7 +423,7 @@ function Auth_OpenID_getDefaultAssociationOrder() { $order = array(); - if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) { + if (!Auth_OpenID_noMathSupport()) { $order[] = array('HMAC-SHA1', 'DH-SHA1'); if (Auth_OpenID_HMACSHA256_SUPPORTED) { diff --git a/Auth/OpenID/BigMath.php b/Auth/OpenID/BigMath.php index 40de144..98815f5 100644 --- a/Auth/OpenID/BigMath.php +++ b/Auth/OpenID/BigMath.php @@ -427,7 +427,7 @@ function &Auth_OpenID_getMathLib() return $lib; } - if (defined('Auth_OpenID_NO_MATH_SUPPORT')) { + if (Auth_OpenID_noMathSupport()) { $null = null; return $null; } @@ -443,7 +443,7 @@ function &Auth_OpenID_getMathLib() } $triedstr = implode(", ", $tried); - define('Auth_OpenID_NO_MATH_SUPPORT', true); + Auth_OpenID_setNoMathSupport(); $result = null; return $result; @@ -456,4 +456,16 @@ function &Auth_OpenID_getMathLib() return $lib; } +function Auth_OpenID_setNoMathSupport() +{ + if (!defined('Auth_OpenID_NO_MATH_SUPPORT')) { + define('Auth_OpenID_NO_MATH_SUPPORT', true); + } +} + +function Auth_OpenID_noMathSupport() +{ + return defined('Auth_OpenID_NO_MATH_SUPPORT'); +} + ?> |