mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 19:33:54 +01:00
handle deprecated warning set_magic_quotes_runtime, do not set magic quotes all the time, only when get_magic_quotes_runtime returns true
This commit is contained in:
parent
4ffe2fc6e0
commit
e86c74ef5d
@ -1512,8 +1512,7 @@ class PHPMailer {
|
|||||||
}
|
}
|
||||||
if (PHP_VERSION < 6)
|
if (PHP_VERSION < 6)
|
||||||
{
|
{
|
||||||
$magic_quotes = get_magic_quotes_runtime();
|
if (function_exists('get_magic_quotes_runtime') && ($magic_quotes = get_magic_quotes_runtime())) set_magic_quotes_runtime(0);
|
||||||
set_magic_quotes_runtime(0);
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if ((@$file_buffer = file_get_contents($path))===false)
|
if ((@$file_buffer = file_get_contents($path))===false)
|
||||||
@ -1523,13 +1522,13 @@ class PHPMailer {
|
|||||||
$file_buffer = $this->EncodeString($file_buffer, $encoding);
|
$file_buffer = $this->EncodeString($file_buffer, $encoding);
|
||||||
if (PHP_VERSION < 6)
|
if (PHP_VERSION < 6)
|
||||||
{
|
{
|
||||||
set_magic_quotes_runtime($magic_quotes);
|
if ($magic_quotes) set_magic_quotes_runtime($magic_quotes);
|
||||||
}
|
}
|
||||||
return $file_buffer;
|
return $file_buffer;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
if (PHP_VERSION < 6)
|
if (PHP_VERSION < 6)
|
||||||
{
|
{
|
||||||
set_magic_quotes_runtime($magic_quotes);
|
if ($magic_quotes) set_magic_quotes_runtime($magic_quotes);
|
||||||
}
|
}
|
||||||
$this->SetError($e->getMessage());
|
$this->SetError($e->getMessage());
|
||||||
return '';
|
return '';
|
||||||
|
Loading…
Reference in New Issue
Block a user