VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: ssc3 on December 02, 2022, 16:12:33 PM

Title: mb_decode_mimeheader in shopfunctions.php
Post by: ssc3 on December 02, 2022, 16:12:33 PM
VirtueMart 4.0.8 10748

The mb_decode_mimeheader function in shopfunctions.php relies on mbstring which is a non-default PHP extension.

This causes a server error, if mbstring is not installed.


$subjectMailer= mb_decode_mimeheader('=?utf-8?B?'.base64_encode($subject).'?=');


elsewhere in Virtuemart, mbstring functions are preceded with

if(function_exists(

to check if they exist first and use alternative code if not.
Title: Re: mb_decode_mimeheader in shopfunctions.php
Post by: Milbo on December 02, 2022, 21:00:41 PM
Thank you, that should work

$subjectMailer= '=?utf-8?B?'.base64_encode($subject).'?=';
if(function_exists('mb_decode_mimeheader')){
$subjectMailer= mb_decode_mimeheader($subjectMailer);
}