From 243f3e8cd1b6c410b4a32b6e00b55afb3ee8b379 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 25 Nov 2010 15:02:21 +0000 Subject: [PATCH] handle deprecated warning set_magic_quotes_runtime, do not set magic quotes all the time, only when get_magic_quotes_runtime returns true --- phpgwapi/inc/class.phpmailer.inc.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.phpmailer.inc.php b/phpgwapi/inc/class.phpmailer.inc.php index 206ad0cb09..9278e28ba1 100644 --- a/phpgwapi/inc/class.phpmailer.inc.php +++ b/phpgwapi/inc/class.phpmailer.inc.php @@ -1501,8 +1501,7 @@ class PHPMailer { } if (PHP_VERSION < 6) { - $magic_quotes = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); + if (function_exists('get_magic_quotes_runtime') && ($magic_quotes = get_magic_quotes_runtime())) set_magic_quotes_runtime(0); } try { if ((@$file_buffer = file_get_contents($path))===false) @@ -1512,13 +1511,13 @@ class PHPMailer { $file_buffer = $this->EncodeString($file_buffer, $encoding); if (PHP_VERSION < 6) { - set_magic_quotes_runtime($magic_quotes); + if ($magic_quotes) set_magic_quotes_runtime($magic_quotes); } return $file_buffer; } catch (Exception $e) { if (PHP_VERSION < 6) { - set_magic_quotes_runtime($magic_quotes); + if ($magic_quotes) set_magic_quotes_runtime($magic_quotes); } $this->SetError($e->getMessage()); return '';