• php substr() function with utf-8 leaves ? marks at the end.

    and it outputs something like this:

    ????????????????…

    HOW TO FIX:
    Open /wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/settings-page.php

    FIND:
    $fb_desc=(intval($fb_desc_chars)>0 ? substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars) : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));

    Replace to:
    $fb_desc=(intval($fb_desc_chars)>0 ? mb_substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars, 'UTF-8') : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));

    FIND:
    $fb_desc=(intval($fb_desc_chars)>0 ? substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars) : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));

    Replace to:
    $fb_desc=(intval($fb_desc_chars)>0 ? mb_substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars, 'UTF-8') : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));

    Please fix on next version, many thank.

    jaideejung007

    https://www.ads-software.com/plugins/wonderm00ns-simple-facebook-open-graph-tags/

  • The topic ‘FIXED: Change "substr" to "mb_substr" for SUPPORT UTF-8 Encoding’ is closed to new replies.