• thomas2070

    (@thomas2070)


    Hi,

    I’ve noticed that my monitoring tool is flagging a deprecated function in use:

    wc-product-table-lite/templates/short_description.php?(Line:?30): Mb_convert_encoding(): handling html entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead

    This issue also appears when I work in debug mode. Will there be an update to address this in a future version?

    Thanks, Thomas

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter thomas2070

    (@thomas2070)

    Fyi, meanwhile I had a look at the code, this solves the error:

    // complete unclosed tags in $content
    
    if(
    
    ??? defined( 'LIBXML_DOTTED_VERSION' ) &&
    
    ??? version_compare( LIBXML_DOTTED_VERSION, '2.7.0', '>' )
    
    ){
    
    ??? $_errors = libxml_use_internal_errors(true);
    
    ??? $dom = new DOMDocument('1.0', 'UTF-8');
    
    ??? $convmap = array(0x80, 0xffff, 0, 0xffff);
    
    ??? $content_encoded = mb_encode_numericentity('<div>' . $content . '</div>', $convmap, 'UTF-8');
    
    ??? $dom->loadHTML($content_encoded, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
    
    ??? $_content = '';
    
    ??? foreach ($dom->documentElement->childNodes as $child) {
    
    ??????? $_content .= $dom->saveHTML($child);
    
    ??? }
    
    ??? $content = $_content;???
    
    ??? libxml_use_internal_errors($_errors);
    
    }
    Plugin Author WC Product Table

    (@wcproducttable)

    Thank you for your feedback! This warning will be taken care of in the coming update for the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Deprecated function error (short description)’ is closed to new replies.