Commit 2d920e05 authored by Brion Vibber's avatar Brion Vibber

Update the (formerly) Janrain OpenID library to 2.2.2 -- bug fixes including...

Update the (formerly) Janrain OpenID library to 2.2.2 -- bug fixes including PHP 5.3 compatibility fix.

Upstream release was tagged at: http://github.com/openid/php-openid/commit/a287b2d85e753c84b3b883ed8ee3ffe8692c8477
parent 923d9ef7
......@@ -20,7 +20,7 @@
/**
* The library version string
*/
define('Auth_OpenID_VERSION', '2.1.3');
define('Auth_OpenID_VERSION', '2.2.2');
/**
* Require the fetcher code.
......@@ -102,9 +102,7 @@ define('Auth_OpenID_digits',
define('Auth_OpenID_punct',
"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");
if (Auth_OpenID_getMathLib() === null) {
Auth_OpenID_setNoMathSupport();
}
Auth_OpenID_include_init();
/**
* The OpenID utility function class.
......@@ -120,7 +118,7 @@ class Auth_OpenID {
*
* @access private
*/
function isFailure($thing)
static function isFailure($thing)
{
return is_a($thing, 'Auth_OpenID_FailureResponse');
}
......@@ -139,9 +137,12 @@ class Auth_OpenID {
* Returns an empty array if neither GET nor POST was used, or if
* POST was used but php://input cannot be opened.
*
* See background:
* http://lists.openidenabled.com/pipermail/dev/2007-March/000395.html
*
* @access private
*/
function getQuery($query_str=null)
static function getQuery($query_str=null)
{
$data = array();
......@@ -177,7 +178,7 @@ class Auth_OpenID {
return $data;
}
function params_from_string($str)
static function params_from_string($str)
{
$chunks = explode("&", $str);
......@@ -190,7 +191,7 @@ class Auth_OpenID {
}
list($k, $v) = $parts;
$data[$k] = urldecode($v);
$data[urldecode($k)] = urldecode($v);
}
return $data;
......@@ -203,7 +204,7 @@ class Auth_OpenID {
*
* @access private
*/
function ensureDir($dir_name)
static function ensureDir($dir_name)
{
if (is_dir($dir_name) || @mkdir($dir_name)) {
return true;
......@@ -225,7 +226,7 @@ class Auth_OpenID {
*
* @access private
*/
function addPrefix($values, $prefix)
static function addPrefix($values, $prefix)
{
$new_values = array();
foreach ($values as $s) {
......@@ -241,7 +242,7 @@ class Auth_OpenID {
*
* @access private
*/
function arrayGet($arr, $key, $fallback = null)
static function arrayGet($arr, $key, $fallback = null)
{
if (is_array($arr)) {
if (array_key_exists($key, $arr)) {
......@@ -261,7 +262,7 @@ class Auth_OpenID {
/**
* Replacement for PHP's broken parse_str.
*/
function parse_str($query)
static function parse_str($query)
{
if ($query === null) {
return null;
......@@ -278,7 +279,7 @@ class Auth_OpenID {
}
list($key, $value) = $pair;
$new_parts[$key] = urldecode($value);
$new_parts[urldecode($key)] = urldecode($value);
}
return $new_parts;
......@@ -295,7 +296,7 @@ class Auth_OpenID {
* pairs from $data into a URL query string
* (e.g. "username=bob&id=56").
*/
function httpBuildQuery($data)
static function httpBuildQuery($data)
{
$pairs = array();
foreach ($data as $key => $value) {
......@@ -323,7 +324,7 @@ class Auth_OpenID {
* @return string $url The original URL with the new parameters added.
*
*/
function appendArgs($url, $args)
static function appendArgs($url, $args)
{
if (count($args) == 0) {
return $url;
......@@ -367,7 +368,7 @@ class Auth_OpenID {
* @return string $url The URL resulting from assembling the
* specified components.
*/
function urlunparse($scheme, $host, $port = null, $path = '/',
static function urlunparse($scheme, $host, $port = null, $path = '/',
$query = '', $fragment = '')
{
......@@ -412,7 +413,7 @@ class Auth_OpenID {
* @return mixed $new_url The URL after normalization, or null if
* $url was malformed.
*/
function normalizeUrl($url)
static function normalizeUrl($url)
{
@$parsed = parse_url($url);
......@@ -443,7 +444,7 @@ class Auth_OpenID {
*
* @access private
*/
function intval($value)
static function intval($value)
{
$re = "/^\\d+$/";
......@@ -461,7 +462,7 @@ class Auth_OpenID {
* @param string $str The string of bytes to count.
* @return int The number of bytes in $str.
*/
function bytes($str)
static function bytes($str)
{
return strlen(bin2hex($str)) / 2;
}
......@@ -470,7 +471,7 @@ class Auth_OpenID {
* Get the bytes in a string independently of multibyte support
* conditions.
*/
function toBytes($str)
static function toBytes($str)
{
$hex = bin2hex($str);
......@@ -486,7 +487,7 @@ class Auth_OpenID {
return $b;
}
function urldefrag($url)
static function urldefrag($url)
{
$parts = explode("#", $url, 2);
......@@ -497,7 +498,7 @@ class Auth_OpenID {
}
}
function filter($callback, &$sequence)
static function filter($callback, &$sequence)
{
$result = array();
......@@ -510,7 +511,7 @@ class Auth_OpenID {
return $result;
}
function update(&$dest, &$src)
static function update(&$dest, &$src)
{
foreach ($src as $k => $v) {
$dest[$k] = $v;
......@@ -524,14 +525,14 @@ class Auth_OpenID {
*
* @param string $format_string The sprintf format for the message
*/
function log($format_string)
static function log($format_string)
{
$args = func_get_args();
$message = call_user_func_array('sprintf', $args);
error_log($message);
}
function autoSubmitHTML($form, $title="OpenId transaction in progress")
static function autoSubmitHTML($form, $title="OpenId transaction in progress")
{
return("<html>".
"<head><title>".
......@@ -549,4 +550,14 @@ class Auth_OpenID {
"</html>");
}
}
?>
/*
* Function to run when this file is included.
* Abstracted to a function to make life easier
* for some PHP optimizers.
*/
function Auth_OpenID_include_init() {
if (Auth_OpenID_getMathLib() === null) {
Auth_OpenID_setNoMathSupport();
}
}
......@@ -38,7 +38,7 @@ class Auth_OpenID_AX {
* @return bool true if $thing is an Auth_OpenID_AX_Error; false
* if not.
*/
function isError($thing)
static function isError($thing)
{
return is_a($thing, 'Auth_OpenID_AX_Error');
}
......@@ -191,7 +191,7 @@ class Auth_OpenID_AX_AttrInfo {
* Construct an attribute information object. For parameter
* details, see the constructor.
*/
function make($type_uri, $count=1, $required=false,
static function make($type_uri, $count=1, $required=false,
$alias=null)
{
if ($alias !== null) {
......@@ -235,7 +235,7 @@ class Auth_OpenID_AX_AttrInfo {
* return null If an alias is present in the list of aliases but
* is not present in the namespace map.
*/
function Auth_OpenID_AX_toTypeURIs(&$namespace_map, $alias_list_s)
function Auth_OpenID_AX_toTypeURIs($namespace_map, $alias_list_s)
{
$uris = array();
......@@ -386,7 +386,7 @@ class Auth_OpenID_AX_FetchRequest extends Auth_OpenID_AX_Message {
* Auth_OpenID_AX_FetchRequest extracted from the request message if
* successful
*/
function &fromOpenIDRequest($request)
static function fromOpenIDRequest($request)
{
$m = $request->message;
$obj = new Auth_OpenID_AX_FetchRequest();
......@@ -484,7 +484,7 @@ class Auth_OpenID_AX_FetchRequest extends Auth_OpenID_AX_Message {
Auth_OpenID::arrayGet($ax_args, 'required'));
foreach ($required as $type_uri) {
$attrib =& $this->requested_attributes[$type_uri];
$attrib = $this->requested_attributes[$type_uri];
$attrib->required = true;
}
......@@ -587,7 +587,7 @@ class Auth_OpenID_AX_KeyValueMessage extends Auth_OpenID_AX_Message {
*
* @access private
*/
function _getExtensionKVArgs(&$aliases)
function _getExtensionKVArgs($aliases)
{
if ($aliases === null) {
$aliases = new Auth_OpenID_NamespaceMap();
......@@ -652,7 +652,7 @@ class Auth_OpenID_AX_KeyValueMessage extends Auth_OpenID_AX_Message {
foreach ($aliases->iteritems() as $pair) {
list($type_uri, $alias) = $pair;
if (array_key_exists('count.' . $alias, $ax_args)) {
if (array_key_exists('count.' . $alias, $ax_args) && ($ax_args['count.' . $alias] !== Auth_OpenID_AX_UNLIMITED_VALUES)) {
$count_key = 'count.' . $alias;
$count_s = $ax_args[$count_key];
......@@ -888,7 +888,7 @@ class Auth_OpenID_AX_FetchResponse extends Auth_OpenID_AX_KeyValueMessage {
$ax_args['update_url'] = $update_url;
}
Auth_OpenID::update(&$ax_args, $kv_args);
Auth_OpenID::update($ax_args, $kv_args);
return $ax_args;
}
......@@ -922,7 +922,7 @@ class Auth_OpenID_AX_FetchResponse extends Auth_OpenID_AX_KeyValueMessage {
* @return $response A FetchResponse containing the data from the
* OpenID message
*/
function fromSuccessResponse($success_response, $signed=true)
static function fromSuccessResponse($success_response, $signed=true)
{
$obj = new Auth_OpenID_AX_FetchResponse();
if ($signed) {
......@@ -960,7 +960,7 @@ class Auth_OpenID_AX_StoreRequest extends Auth_OpenID_AX_KeyValueMessage {
{
$ax_args = $this->_newArgs();
$kv_args = $this->_getExtensionKVArgs($aliases);
Auth_OpenID::update(&$ax_args, $kv_args);
Auth_OpenID::update($ax_args, $kv_args);
return $ax_args;
}
}
......@@ -980,7 +980,7 @@ class Auth_OpenID_AX_StoreResponse extends Auth_OpenID_AX_Message {
* Returns Auth_OpenID_AX_Error on error or an
* Auth_OpenID_AX_StoreResponse object on success.
*/
function &make($succeeded=true, $error_message=null)
function make($succeeded=true, $error_message=null)
{
if (($succeeded) && ($error_message !== null)) {
return new Auth_OpenID_AX_Error('An error message may only be '.
......@@ -1020,4 +1020,3 @@ class Auth_OpenID_AX_StoreResponse extends Auth_OpenID_AX_Message {
}
}
?>
\ No newline at end of file
......@@ -94,7 +94,7 @@ class Auth_OpenID_Association {
* @return association An {@link Auth_OpenID_Association}
* instance.
*/
function fromExpiresIn($expires_in, $handle, $secret, $assoc_type)
static function fromExpiresIn($expires_in, $handle, $secret, $assoc_type)
{
$issued = time();
$lifetime = $expires_in;
......@@ -132,7 +132,7 @@ class Auth_OpenID_Association {
$handle, $secret, $issued, $lifetime, $assoc_type)
{
if (!in_array($assoc_type,
Auth_OpenID_getSupportedAssociationTypes())) {
Auth_OpenID_getSupportedAssociationTypes(), true)) {
$fmt = 'Unsupported association type (%s)';
trigger_error(sprintf($fmt, $assoc_type), E_USER_ERROR);
}
......@@ -206,7 +206,7 @@ class Auth_OpenID_Association {
* @param string $assoc_s Association as serialized by serialize()
* @return Auth_OpenID_Association $result instance of this class
*/
function deserialize($class_name, $assoc_s)
static function deserialize($class_name, $assoc_s)
{
$pairs = Auth_OpenID_KVForm::toArray($assoc_s, $strict = true);
$keys = array();
......@@ -327,7 +327,7 @@ class Auth_OpenID_Association {
*
* @access private
*/
function _makePairs(&$message)
function _makePairs($message)
{
$signed = $message->getArg(Auth_OpenID_OPENID_NS, 'signed');
if (!$signed || Auth_OpenID::isFailure($signed)) {
......@@ -352,7 +352,7 @@ class Auth_OpenID_Association {
*
* @access private
*/
function getMessageSignature(&$message)
function getMessageSignature($message)
{
$pairs = $this->_makePairs($message);
return base64_encode($this->sign($pairs));
......@@ -364,7 +364,7 @@ class Auth_OpenID_Association {
*
* @access private
*/
function checkMessageSignature(&$message)
function checkMessageSignature($message)
{
$sig = $message->getArg(Auth_OpenID_OPENID_NS,
'sig');
......@@ -469,18 +469,16 @@ function Auth_OpenID_getOnlyEncryptedOrder()
return $result;
}
function &Auth_OpenID_getDefaultNegotiator()
function Auth_OpenID_getDefaultNegotiator()
{
$x = new Auth_OpenID_SessionNegotiator(
return new Auth_OpenID_SessionNegotiator(
Auth_OpenID_getDefaultAssociationOrder());
return $x;
}
function &Auth_OpenID_getEncryptedNegotiator()
function Auth_OpenID_getEncryptedNegotiator()
{
$x = new Auth_OpenID_SessionNegotiator(
return new Auth_OpenID_SessionNegotiator(
Auth_OpenID_getOnlyEncryptedOrder());
return $x;
}
/**
......@@ -610,4 +608,3 @@ class Auth_OpenID_SessionNegotiator {
}
}
?>
\ No newline at end of file
......@@ -351,8 +351,7 @@ function Auth_OpenID_math_extensions()
'class' => 'Auth_OpenID_GmpMathWrapper');
}
$result[] = array(
'modules' => array('bcmath', 'php_bcmath'),
$result[] = array('modules' => array('bcmath', 'php_bcmath'),
'extension' => 'bcmath',
'class' => 'Auth_OpenID_BcMathWrapper');
......@@ -366,27 +365,9 @@ function Auth_OpenID_detectMathLibrary($exts)
{
$loaded = false;
$hasDl = function_exists('dl');
foreach ($exts as $extension) {
// See if the extension specified is already loaded.
if ($extension['extension'] &&
extension_loaded($extension['extension'])) {
$loaded = true;
}
// Try to load dynamic modules.
if (!$loaded) {
foreach ($extension['modules'] as $module) {
if (@dl($module . "." . PHP_SHLIB_SUFFIX)) {
$loaded = true;
break;
}
}
}
// If the load succeeded, supply an instance of
// Auth_OpenID_MathWrapper which wraps the specified
// module's functionality.
if ($loaded) {
if (extension_loaded($extension['extension'])) {
return $extension;
}
}
......@@ -405,7 +386,7 @@ function Auth_OpenID_detectMathLibrary($exts)
* instance of a wrapper for that extension module. If no extension
* module is found, an instance of {@link Auth_OpenID_MathWrapper} is
* returned, which wraps the native PHP integer implementation. The
* proper calling convention for this method is $lib =&
* proper calling convention for this method is $lib =
* Auth_OpenID_getMathLib().
*
* This function checks for the existence of specific long number
......@@ -416,7 +397,7 @@ function Auth_OpenID_detectMathLibrary($exts)
*
* @package OpenID
*/
function &Auth_OpenID_getMathLib()
function Auth_OpenID_getMathLib()
{
// The instance of Auth_OpenID_MathWrapper that we choose to
// supply will be stored here, so that subseqent calls to this
......@@ -468,4 +449,4 @@ function Auth_OpenID_noMathSupport()
return defined('Auth_OpenID_NO_MATH_SUPPORT');
}
?>
......@@ -258,19 +258,19 @@ class Auth_OpenID_Consumer {
* when creating the internal consumer object. This is used for
* testing.
*/
function Auth_OpenID_Consumer(&$store, $session = null,
function Auth_OpenID_Consumer($store, $session = null,
$consumer_cls = null)
{
if ($session === null) {
$session = new Auth_Yadis_PHPSession();
}
$this->session =& $session;
$this->session = $session;
if ($consumer_cls !== null) {
$this->consumer =& new $consumer_cls($store);
$this->consumer = new $consumer_cls($store);
} else {
$this->consumer =& new Auth_OpenID_GenericConsumer($store);
$this->consumer = new Auth_OpenID_GenericConsumer($store);
}
$this->_token_key = $this->session_key_prefix . $this->_token_suffix;
......@@ -281,7 +281,7 @@ class Auth_OpenID_Consumer {
*
* @access private
*/
function getDiscoveryObject(&$session, $openid_url,
function getDiscoveryObject($session, $openid_url,
$session_key_prefix)
{
return new Auth_Yadis_Discovery($session, $openid_url,
......@@ -339,7 +339,7 @@ class Auth_OpenID_Consumer {
$this->consumer->fetcher);
// Reset the 'stale' attribute of the manager.
$m =& $disco->getManager();
$m = $disco->getManager();
if ($m) {
$m->stale = false;
$disco->session->set($disco->session_key,
......@@ -370,7 +370,7 @@ class Auth_OpenID_Consumer {
* @return Auth_OpenID_AuthRequest $auth_request An OpenID
* authentication request object.
*/
function &beginWithoutDiscovery($endpoint, $anonymous=false)
function beginWithoutDiscovery($endpoint, $anonymous=false)
{
$loader = new Auth_OpenID_ServiceEndpointLoader();
$auth_req = $this->consumer->begin($endpoint);
......@@ -467,7 +467,7 @@ class Auth_OpenID_DiffieHellmanSHA1ConsumerSession {
function getRequest()
{
$math =& Auth_OpenID_getMathLib();
$math = Auth_OpenID_getMathLib();
$cpub = $math->longToBase64($this->dh->public);
......@@ -496,7 +496,7 @@ class Auth_OpenID_DiffieHellmanSHA1ConsumerSession {
return null;
}
$math =& Auth_OpenID_getMathLib();
$math = Auth_OpenID_getMathLib();
$spub = $math->base64ToLong($response->getArg(Auth_OpenID_OPENID_NS,
'dh_server_public'));
......@@ -611,11 +611,11 @@ class Auth_OpenID_GenericConsumer {
* in the module description. The default value is False, which
* disables immediate mode.
*/
function Auth_OpenID_GenericConsumer(&$store)
function Auth_OpenID_GenericConsumer($store)
{
$this->store =& $store;
$this->negotiator =& Auth_OpenID_getDefaultNegotiator();
$this->_use_assocs = ($this->store ? true : false);
$this->store = $store;
$this->negotiator = Auth_OpenID_getDefaultNegotiator();
$this->_use_assocs = (is_null($this->store) ? false : true);
$this->fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
......@@ -665,14 +665,14 @@ class Auth_OpenID_GenericConsumer {
$method = Auth_OpenID::arrayGet($mode_methods, $mode,
'_completeInvalid');
return call_user_func_array(array(&$this, $method),
array($message, $endpoint, $return_to));
return call_user_func_array(array($this, $method),
array($message, &$endpoint, $return_to));
}
/**
* @access private
*/
function _completeInvalid($message, &$endpoint, $unused)
function _completeInvalid($message, $endpoint, $unused)
{
$mode = $message->getArg(Auth_OpenID_OPENID_NS, 'mode',
'<No mode set>');
......@@ -684,7 +684,7 @@ class Auth_OpenID_GenericConsumer {
/**
* @access private
*/
function _complete_cancel($message, &$endpoint, $unused)
function _complete_cancel($message, $endpoint, $unused)
{
return new Auth_OpenID_CancelResponse($endpoint);
}
......@@ -692,7 +692,7 @@ class Auth_OpenID_GenericConsumer {
/**
* @access private
*/
function _complete_error($message, &$endpoint, $unused)
function _complete_error($message, $endpoint, $unused)
{
$error = $message->getArg(Auth_OpenID_OPENID_NS, 'error');
$contact = $message->getArg(Auth_OpenID_OPENID_NS, 'contact');
......@@ -705,7 +705,7 @@ class Auth_OpenID_GenericConsumer {
/**
* @access private
*/
function _complete_setup_needed($message, &$endpoint, $unused)
function _complete_setup_needed($message, $endpoint, $unused)
{
if (!$message->isOpenID2()) {
return $this->_completeInvalid($message, $endpoint);
......@@ -719,7 +719,7 @@ class Auth_OpenID_GenericConsumer {
/**
* @access private
*/
function _complete_id_res($message, &$endpoint, $return_to)
function _complete_id_res($message, $endpoint, $return_to)
{
$user_setup_url = $message->getArg(Auth_OpenID_OPENID1_NS,
'user_setup_url');
......@@ -1181,7 +1181,7 @@ class Auth_OpenID_GenericConsumer {
// oidutil.log('Performing discovery on %s' % (claimed_id,))
list($unused, $services) = call_user_func($this->discoverMethod,
$claimed_id,
$this->fetcher);
&$this->fetcher);
if (!$services) {
return new Auth_OpenID_FailureResponse(null,
......@@ -1197,7 +1197,7 @@ class Auth_OpenID_GenericConsumer {
* @access private
*/
function _verifyDiscoveryServices($claimed_id,
&$services, &$to_match_endpoints)
$services, $to_match_endpoints)
{
// Search the services resulting from discovery to find one
// that matches the information from the assertion
......@@ -1216,8 +1216,8 @@ class Auth_OpenID_GenericConsumer {
}
return new Auth_OpenID_FailureResponse(null,
sprintf('No matching endpoint found after discovering %s',
$claimed_id));
sprintf('No matching endpoint found after discovering %s: %s',
$claimed_id, $result->message));
}
/**
......@@ -1397,7 +1397,7 @@ class Auth_OpenID_GenericConsumer {
*
* @access private
*/
function _httpResponseToMessage($response, $server_url)
static function _httpResponseToMessage($response, $server_url)
{
// Should this function be named Message.fromHTTPResponse instead?
$response_message = Auth_OpenID_Message::fromKVForm($response->body);
......@@ -1461,7 +1461,7 @@ class Auth_OpenID_GenericConsumer {
*
* @access private
*/
function _extractSupportedAssociationType(&$server_error, &$endpoint,
function _extractSupportedAssociationType($server_error, $endpoint,
$assoc_type)
{
// Any error message whose code is not 'unsupported-type'
......@@ -1566,7 +1566,7 @@ class Auth_OpenID_GenericConsumer {
/**
* @access private
*/
function _extractAssociation(&$assoc_response, &$assoc_session)
function _extractAssociation($assoc_response, $assoc_session)
{
// Extract the common fields from the response, raising an
// exception if they are not found
......@@ -1748,10 +1748,10 @@ class Auth_OpenID_AuthRequest {
* class. Instances of this class are created by the library when
* needed.
*/
function Auth_OpenID_AuthRequest(&$endpoint, $assoc)
function Auth_OpenID_AuthRequest($endpoint, $assoc)
{
$this->assoc = $assoc;
$this->endpoint =& $endpoint;
$this->endpoint = $endpoint;
$this->return_to_args = array();
$this->message = new Auth_OpenID_Message(
$endpoint->preferredNamespace());
......@@ -1764,7 +1764,7 @@ class Auth_OpenID_AuthRequest {
* $extension_request: An object that implements the extension
* request interface for adding arguments to an OpenID message.
*/
function addExtension(&$extension_request)
function addExtension($extension_request)
{
$extension_request->toMessage($this->message);
}
......@@ -2089,7 +2089,7 @@ class Auth_OpenID_SuccessResponse extends Auth_OpenID_ConsumerResponse {
foreach ($msg_args as $key => $value) {
if (!$this->isSigned($ns_uri, $key)) {
return null;
unset($msg_args[$key]);
}
}
......@@ -2167,7 +2167,7 @@ class Auth_OpenID_ServerErrorContainer {
/**
* @access private
*/
function fromMessage($message)
static function fromMessage($message)
{
$error_text = $message->getArg(
Auth_OpenID_OPENID_NS, 'error', '<no error message supplied>');
......@@ -2227,4 +2227,4 @@ class Auth_OpenID_SetupNeededResponse extends Auth_OpenID_ConsumerResponse {
}
}
?>
......@@ -37,7 +37,7 @@ class Auth_OpenID_CryptUtil {
* @param int $num_bytes The length of the return value
* @return string $bytes random bytes
*/
function getBytes($num_bytes)
static function getBytes($num_bytes)
{
static $f = null;
$bytes = '';
......@@ -77,7 +77,7 @@ class Auth_OpenID_CryptUtil {
* @return string $result A string of randomly-chosen characters
* from $chrs
*/
function randomString($length, $population = null)
static function randomString($length, $population = null)
{
if ($population === null) {
return Auth_OpenID_CryptUtil::getBytes($length);
......@@ -106,4 +106,3 @@ class Auth_OpenID_CryptUtil {
}
}
?>
\ No newline at end of file
......@@ -128,4 +128,3 @@ class Auth_OpenID_DatabaseConnection {
}
}
?>
\ No newline at end of file
......@@ -51,9 +51,9 @@ class Auth_OpenID_DiffieHellman {
$private = null, $lib = null)
{
if ($lib === null) {
$this->lib =& Auth_OpenID_getMathLib();
$this->lib = Auth_OpenID_getMathLib();
} else {
$this->lib =& $lib;