summaryrefslogtreecommitdiffstats
path: root/PHPMailer-path.patch
blob: 3b7b33059e5f696269b3f1498b1afad91ff2b1fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff -up ./class.phpmailer.php.rpm ./class.phpmailer.php
--- ./class.phpmailer.php.rpm	2020-03-19 15:29:37.000000000 +0100
+++ ./class.phpmailer.php	2021-03-26 10:33:39.989407757 +0100
@@ -1534,6 +1534,7 @@ class PHPMailer
     public function getSMTPInstance()
     {
         if (!is_object($this->smtp)) {
+            require_once 'class.smtp.php';
             $this->smtp = new SMTP;
         }
         return $this->smtp;
@@ -1795,7 +1796,7 @@ class PHPMailer
         );
         if (empty($lang_path)) {
             // Calculate an absolute path so it can work if CWD is not here
-            $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
+            $lang_path = '/usr/share/PHPMailer/language/';
         }
         //Validate $langcode
         if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
diff -up ./PHPMailerAutoload.php.rpm ./PHPMailerAutoload.php
--- ./PHPMailerAutoload.php.rpm	2021-03-26 10:34:09.218276732 +0100
+++ ./PHPMailerAutoload.php	2021-03-26 10:34:35.311159763 +0100
@@ -30,20 +30,4 @@ function PHPMailerAutoload($classname)
     }
 }
 
-if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
-    //SPL autoloading was introduced in PHP 5.1.2
-    if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
-        spl_autoload_register('PHPMailerAutoload', true, true);
-    } else {
-        spl_autoload_register('PHPMailerAutoload');
-    }
-} else {
-    /**
-     * Fall back to traditional autoload for old PHP versions
-     * @param string $classname The name of the class to load
-     */
-    function __autoload($classname)
-    {
-        PHPMailerAutoload($classname);
-    }
-}
+spl_autoload_register('PHPMailerAutoload', true, true);