New hook for decoding message body
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 26 Sep 2003 07:30:42 +0000 (07:30 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 26 Sep 2003 07:30:42 +0000 (07:30 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5776 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 53fa5a8..933523b 100644 (file)
@@ -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);