X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fmime.php;h=0f9c7fe1d4e2b328ad45ca321273ff5d3f8867ea;hb=bd3ebe3f8f07fd1b4294a30ef0c09a641eea1e77;hp=63d6d2dfc1606683d4118944cb14bdafde0ed583;hpb=3047e291f2982efe9501ec790faafd3da843d22d;p=squirrelmail.git diff --git a/functions/mime.php b/functions/mime.php index 63d6d2df..0f9c7fe1 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -6,7 +6,7 @@ * This contains the functions necessary to detect and decode MIME * messages. * - * @copyright 1999-2012 The SquirrelMail Project Team + * @copyright 1999-2017 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -806,6 +806,7 @@ function decodeHeader ($string, $utfencode=true,$htmlsafe=true,$decide=false) { $iLastMatch = -2; $encoded = true; +// FIXME: spaces are allowed inside quoted-printable encoding, but the following line will bust up any such encoded strings $aString = explode(' ',$string); $ret = ''; foreach ($aString as $chunk) { @@ -867,7 +868,8 @@ function decodeHeader ($string, $utfencode=true,$htmlsafe=true,$decide=false) { break; case 'Q': $replace = str_replace('_', ' ', $res[4]); - $replace = preg_replace('/=([0-9a-f]{2})/ie', 'chr(hexdec("\1"))', + $replace = preg_replace_callback('/=([0-9a-f]{2})/i', + create_function ('$matches', 'return chr(hexdec($matches[1]));'), $replace); if ($utfencode) { if ($can_be_encoded) { @@ -1896,7 +1898,9 @@ function sq_fix_url($attname, &$attvalue, $message, $id, $mailbox,$sQuote = '"') // images off by default. sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET, FALSE); - $secremoveimg = '../images/' . _("sec_remove_eng.png"); + global $use_transparent_security_image; + if ($use_transparent_security_image) $secremoveimg = '../images/spacer.png'; + else $secremoveimg = '../images/' . _("sec_remove_eng.png"); /** * Replace empty src tags with the blank image. src is only used @@ -2109,7 +2113,11 @@ function sq_fixstyle($body, $pos, $message, $id, $mailbox){ * and change it to .bodyclass so we can just assign it to a
*/ $content = preg_replace("|body(\s*\{.*?\})|si", ".bodyclass\\1", $content); - $secremoveimg = '../images/' . _("sec_remove_eng.png"); + + global $use_transparent_security_image; + if ($use_transparent_security_image) $secremoveimg = '../images/spacer.png'; + else $secremoveimg = '../images/' . _("sec_remove_eng.png"); + /** * Fix url('blah') declarations. */ @@ -2547,7 +2555,10 @@ function magicHTML($body, $id, $message, $mailbox = 'INBOX', $take_mailto_links ) ); - $secremoveimg = "../images/" . _("sec_remove_eng.png"); + global $use_transparent_security_image; + if ($use_transparent_security_image) $secremoveimg = '../images/spacer.png'; + else $secremoveimg = '../images/' . _("sec_remove_eng.png"); + $bad_attvals = Array( "/.*/" => Array(