Update magic quotes -set 0 -php7x

Update for compatibility with Antspam etc.
This commit is contained in:
gtbu 2022-04-15 14:23:32 +02:00
parent 4330d84faa
commit 201211d80b

View file

@ -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 '';
}
}
}
/**