CRM-8597, CRM-20561 - Restore fix for `&`
authorTim Otten <totten@civicrm.org>
Fri, 16 Jun 2017 03:13:22 +0000 (20:13 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 16 Jun 2017 03:14:23 +0000 (20:14 -0700)
tools/scripts/composer/net-smtp-fix.sh
tools/scripts/composer/patches/net-smtp-ref-patch.txt [new file with mode: 0644]

index 87721739d9566205c1fee5c5d56290602eb56083..c01f908adec08961b42971ab1e780deb0ee0f58e 100755 (executable)
@@ -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 (file)
index 0000000..84f080d
--- /dev/null
@@ -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))) {