From 138dd438c6cd3554e620ce1d2000d93089c07625 Mon Sep 17 00:00:00 2001 From: Matthew King Date: Fri, 13 May 2016 22:19:36 +0100 Subject: [PATCH] Fix issues with mandrill and PHP7 when using attachments --- lib/mandrill.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/mandrill.class.php b/lib/mandrill.class.php index 4803b32..88edf82 100644 --- a/lib/mandrill.class.php +++ b/lib/mandrill.class.php @@ -533,11 +533,11 @@ static function getAttachmentStruct($path) { $filename = basename($path); - if ( !function_exists('get_magic_quotes') ) { - function get_magic_quotes() { return false; } + if ( !function_exists('get_magic_quotes_runtime') ) { + function get_magic_quotes_runtime() { return false; } } - if ( !function_exists('set_magic_quotes') ) { - function set_magic_quotes($value) { return true;} + if ( !function_exists('set_magic_quotes_runtime') ) { + function set_magic_quotes_runtime($value) { return true;} } if (strnatcmp(phpversion(),'6') >= 0) { @@ -548,7 +548,9 @@ function set_magic_quotes($value) { return true;} $file_buffer = file_get_contents($path); $file_buffer = chunk_split(base64_encode($file_buffer), 76, "\n"); - if (strnatcmp(phpversion(),'6') >= 0) set_magic_quotes_runtime($magic_quotes); + if (strnatcmp(phpversion(),'6') >= 0) { + set_magic_quotes_runtime($magic_quotes); + } $mime_type = ''; if ( function_exists('finfo_open') && function_exists('finfo_file') ) {