Cakephp: Getting ErrorException : mb_encode_mimeheader() is bugged when setting CakeEmail->subject()

Created on 22 Mar 2016  路  3Comments  路  Source: cakephp/cakephp

This is the test I'm running, where setting the subject is line 134 in the stacktrace.

    public function test_mb_encode_mimeheader()
    {
        $CakeEmail = new CakeEmail();
        $CakeEmail->subject('Cur abnoba studere?');
    }

Stacktrace:

ErrorException : mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead, File: /var/www/html/vendors/symfony/polyfill-mbstring/Mbstring.php, Line: 134
 /var/www/html/vendors/symfony/polyfill-mbstring/Mbstring.php:134
 /var/www/html/vendors/symfony/polyfill-mbstring/bootstrap.php:21
 /var/www/html/vendors/cakephp/cakephp/lib/Cake/Network/Email/CakeEmail.php:1338
 /var/www/html/vendors/cakephp/cakephp/lib/Cake/Network/Email/CakeEmail.php:691
 /var/www/html/app/Test/Case/Controller/SystemControllerTest.php:29
 /var/www/html/vendors/cakephp/cakephp/lib/Cake/TestSuite/CakeTestCase.php:82
 /var/www/html/vendors/cakephp/cakephp/lib/Cake/TestSuite/CakeTestRunner.php:62
 /var/www/html/vendors/cakephp/cakephp/lib/Cake/TestSuite/CakeTestSuiteCommand.php:98

I suppose the call to mb_encode_mimeheader in CakeEmail.php, line 1338 has to be replaced.

Edit:
Realized that symfony/polyfill-mbstring is a dependency of symfony/console which in turn is a dependency of phploc/phploc and sebastian/phpcpd so maybe I should post my issue elsewhere...

Most helpful comment

Installed php7.0-mbstring, fixed it :sweat:

All 3 comments

Installed php7.0-mbstring, fixed it :sweat:

Hi,
Is the php7.0-mbstring should be still mandatory? because I had similar issue on cakePHP 3.4.10, ubuntu 16.04,
Installing the package did fix the warning and the issue in the mail subject.

@kevanescence yes mbstring is still a requirement for CakePHP.

Was this page helpful?
0 / 5 - 0 ratings