diff --git a/tools/scripts/composer/net-smtp-fix.sh b/tools/scripts/composer/net-smtp-fix.sh index 87721739d956..c01f908adec0 100755 --- a/tools/scripts/composer/net-smtp-fix.sh +++ b/tools/scripts/composer/net-smtp-fix.sh @@ -21,3 +21,6 @@ fi if ! grep -q 'function __construct' vendor/pear/net_smtp/Net/SMTP.php; then patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-php7-patch.txt fi +if grep -q '&Auth_SASL::factory' vendor/pear/net_smtp/Net/SMTP.php; then +patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-ref-patch.txt +fi \ No newline at end of file diff --git a/tools/scripts/composer/patches/net-smtp-ref-patch.txt b/tools/scripts/composer/patches/net-smtp-ref-patch.txt new file mode 100644 index 000000000000..84f080d19eea --- /dev/null +++ b/tools/scripts/composer/patches/net-smtp-ref-patch.txt @@ -0,0 +1,22 @@ +--- SMTP.php 2017-06-15 20:08:34.696988543 -0700 ++++ SMTP.php.new 2017-06-15 20:08:25.951703778 -0700 +@@ -732,7 +732,8 @@ + } + + $challenge = base64_decode($this->_arguments[0]); +- $digest = &Auth_SASL::factory('digest-md5'); ++ // CRM-8597 ++ $digest = Auth_SASL::factory('digest-md5'); + $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge, + $this->host, "smtp", + $authz)); +@@ -784,7 +785,8 @@ + } + + $challenge = base64_decode($this->_arguments[0]); +- $cram = &Auth_SASL::factory('cram-md5'); ++ // CRM-8597 ++ $cram = Auth_SASL::factory('cram-md5'); + $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge)); + + if (PEAR::isError($error = $this->_put($auth_str))) {