skip to Main Content

Warning in ./../../php/tcpdf/include/tcpdf_fonts.php#1671
chr() expects parameter 1 to be int, string given

Backtrace

tcpdf_fonts.php#1671: chr(string ”)
tcpdf_fonts.php#1803: TCPDF_FONTS::unichr(
string ”,
boolean true,
)
tcpdf_fonts.php#2095: TCPDF_FONTS::UTF8ArrSubString(
array,
integer 0,
integer 1,
boolean true,
)
tcpdf.php#1960: TCPDF_FONTS::utf8Bidi(
array,
string ”,
boolean false,
boolean true,
NULL,
)
./libraries/classes/Pdf.php#50: TCPDF->__construct(
string ‘L’,
string ‘pt’,
string ‘A3’,
boolean true,
string ‘UTF-8’,
boolean false,
boolean false,
)
./libraries/classes/Plugins/Export/Helpers/Pdf.php#58: PhpMyAdminPdf->__construct(
string ‘L’,
string ‘pt’,
string ‘A3’,
boolean true,
string ‘UTF-8’,
boolean false,
boolean false,
)
./libraries/classes/Plugins/Export/ExportPdf.php#70: PhpMyAdminPluginsExportHelpersPdf->__construct(
string ‘L’,
string ‘pt’,
string ‘A3’,
)
./libraries/classes/Plugins/Export/ExportPdf.php#55: PhpMyAdminPluginsExportExportPdf->initSpecificVariables()enter image description here
./libraries/classes/Plugins.php#99: PhpMyAdminPluginsExportExportPdf->__construct()
./libraries/classes/Display/Export.php#677: PhpMyAdminPlugins::getPlugins(
string ‘export’,
string ‘libraries/classes/Plugins/Export/’,
array,
)
./db_export.php#147: PhpMyAdminDisplayExport->getDisplay(
string ‘database’,
string ‘wordpress’,
string ”,
string ”,
integer 14,
integer 0,
string ‘TablesStructureDataSelect all wp_commentmetawp_commentswp_linkswp_optionswp_postmetawp_postswp_termmetawp_termswp_term_relationshipswp_term_taxonomywp_usermetawp_userswp_yoast_seo_linkswp_yoast_seo_meta ‘,
)

enter image description here

3

Answers


  1. Chosen as BEST ANSWER

    I have fixed this issue simply I have upgraded the PHPMyAdmin and MYSQL latest version.


  2. One quick solution is to downgrade your PHP version, assuming you are running on PHP 7.4. Alternatively refer to this URL https://github.com/tecnickcom/TCPDF/pull/123/commits/34eb0dff48eb0b0d5f38f4cfd92ef6d47aefc8b4

    There is a fix for this error with TCPDF

    Login or Signup to reply.
  3. Run this command:

    sudo nano +1671 /usr/share/php/tcpdf/include/tcpdf_fonts.php
    

    Add this condition is_numeric($c) in the public method body, so change:

    public static function unichr($c, $unicode=true) {
        if (!$unicode) {
            return chr($c);
        } elseif ($c <= 0x7F) {
            // one byte
            return chr($c);
        } elseif ($c <= 0x7FF) {
            // two bytes
            return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);
        } elseif ($c <= 0xFFFF) {
            // three bytes
            return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
        } elseif ($c <= 0x10FFFF) {
            // four bytes
            return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
        } else {
            return '';
        }
    }
    

    To

    public static function unichr($c, $unicode=true) {
        if (is_numeric($c)){
            if (!$unicode) {
                return chr($c);
            } elseif ($c <= 0x7F) {
                // one byte
                return chr($c);
            } elseif ($c <= 0x7FF) {
                // two bytes
                return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F);
            } elseif ($c <= 0xFFFF) {
                // three bytes
                return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
            } elseif ($c <= 0x10FFFF) {
                // four bytes
                return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F);
            } else {
                return '';
            }
        }
    }
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search