Skip to content

Commit

Permalink
Improve PHP 5 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianheine committed Oct 8, 2010
1 parent c78da98 commit 8fb7137
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion Auth/OpenID/BigMath.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ function Auth_OpenID_detectMathLibrary($exts)
{
$loaded = false;

$hasDl = function_exists('dl');
foreach ($exts as $extension) {
if (extension_loaded($extension['extension'])) {
return $extension;
Expand Down
2 changes: 1 addition & 1 deletion Auth/OpenID/Consumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ function _discoverAndVerify($claimed_id, $to_match_endpoints)
// 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,
Expand Down
7 changes: 7 additions & 0 deletions Auth/OpenID/HMAC.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ function Auth_OpenID_HMACSHA1($key, $text)
$key = Auth_OpenID_SHA1($key, true);
}

if (function_exists('hash_hmac') &&
function_exists('hash_algos') &&
(in_array('sha1', hash_algos()))) {
return hash_hmac('sha1', $text, $key, true);
}
// Home-made solution

$key = str_pad($key, Auth_OpenID_SHA1_BLOCKSIZE, chr(0x00));
$ipad = str_repeat(chr(0x36), Auth_OpenID_SHA1_BLOCKSIZE);
$opad = str_repeat(chr(0x5c), Auth_OpenID_SHA1_BLOCKSIZE);
Expand Down
2 changes: 1 addition & 1 deletion Auth/Yadis/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ function getNextService($discover_cb, $fetcher)

list($yadis_url, $services) = call_user_func($discover_cb,
$this->url,
$fetcher);
&$fetcher);

$manager = $this->createManager($services, $yadis_url);
}
Expand Down

0 comments on commit 8fb7137

Please sign in to comment.