From 5166f86aad45f37b514887adfc014dd305be0e0e Mon Sep 17 00:00:00 2001 From: pdontthink Date: Fri, 26 Sep 2003 07:30:42 +0000 Subject: [PATCH] New hook for decoding message body git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5776 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/functions/mime.php b/functions/mime.php index 53fa5a85..933523b5 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -551,7 +551,15 @@ function decodeBody($body, $encoding) { $body = str_replace("\r\n", "\n", $body); $encoding = strtolower($encoding); - if ($encoding == 'quoted-printable' || + $encoding_handler = do_hook_function('decode_body', $encoding); + + + // plugins get first shot at decoding the body + // + if (!empty($encoding_handler) && function_exists($encoding_handler)) { + $body = $encoding_handler('decode', $body); + + } else if ($encoding == 'quoted-printable' || $encoding == 'quoted_printable') { $body = quoted_printable_decode($body); -- 2.25.1