From 201211d80b9421b96969512425d50487eaf10da5 Mon Sep 17 00:00:00 2001 From: gtbu Date: Fri, 15 Apr 2022 14:23:32 +0200 Subject: [PATCH] Update magic quotes -set 0 -php7x Update for compatibility with Antspam etc. --- .../thirdparty/PHPMailer/class.phpmailer.php | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/include/thirdparty/PHPMailer/class.phpmailer.php b/include/thirdparty/PHPMailer/class.phpmailer.php index 12a9587..0c1bdbe 100644 --- a/include/thirdparty/PHPMailer/class.phpmailer.php +++ b/include/thirdparty/PHPMailer/class.phpmailer.php @@ -2710,32 +2710,18 @@ class PHPMailer try { if (!self::isPermittedPath($path) or !file_exists($path)) { throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); - } - $magic_quotes = get_magic_quotes_runtime(); - if ($magic_quotes) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime(false); - } else { - //Doesn't exist in PHP 5.4, but we don't need to check because - //get_magic_quotes_runtime always returns false in 5.4+ - //so it will never get here - ini_set('magic_quotes_runtime', false); } - } + // or : Deaktiviere https://www.php.net/get_magic_quotes_runtime/ + ini_set('magic_quotes_runtime', 0); + $file_buffer = file_get_contents($path); - $file_buffer = $this->encodeString($file_buffer, $encoding); - if ($magic_quotes) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime($magic_quotes); - } else { - ini_set('magic_quotes_runtime', $magic_quotes); - } - } + $file_buffer = $this->encodeString($file_buffer, $encoding); return $file_buffer; - } catch (Exception $exc) { + } + catch (Exception $exc) { $this->setError($exc->getMessage()); return ''; - } + } } /**