Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Workaround E_DEPRECATED warning on Auth_SASL::factory() call
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Aug 16, 2016
1 parent e8fe05a commit 114dcd7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sieve.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,11 @@ function _authCRAMMD5($user, $pass, $euser)
return $challenge;
}

$auth_sasl = new Auth_SASL;
$cram = $auth_sasl->factory('crammd5');
$challenge = base64_decode(trim($challenge));
$cram = Auth_SASL::factory('crammd5');
$response = $cram->getResponse($user, $pass, $challenge);
$response = $cram->getResponse($user, $pass, $challenge);

if (is_a($response, 'PEAR_Error')) {
return $response;
}
Expand All @@ -725,8 +727,10 @@ function _authDigestMD5($user, $pass, $euser)
return $challenge;
}

$auth_sasl = new Auth_SASL;
$digest = $auth_sasl->factory('digestmd5');
$challenge = base64_decode(trim($challenge));
$digest = Auth_SASL::factory('digestmd5');

// @todo Really 'localhost'?
$response = $digest->getResponse($user, $pass, $challenge, 'localhost', 'sieve', $euser);
if (is_a($response, 'PEAR_Error')) {
Expand Down

0 comments on commit 114dcd7

Please sign in to comment.