WordPress.org

Ready to get started?Download WordPress

Forums

Greg's Comment Length Limiter
[resolved] Problem with diacritic (2 posts)

  1. michal.lohnisky
    Member
    Posted 3 years ago #

    Hello,

    my language (Czech) use letters with diacritic ("ěščřžýáíé ...").
    In utf-8 strlen('ě') == 2.

    Problem:
    upper limit is "6"
    comment box contains "abcědef"
    result would be "abcěde"
    but in real is "abcěd"

    Solution:
    in function comment_trimmer add before 1st line
    $length += (strlen($totrim) - mb_strlen($totrim, get_option('blog_charset')));

    Michal

    http://wordpress.org/extend/plugins/gregs-comment-length-limiter/

  2. GregMulhauser
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Michal,

    Many thanks for the catch! I've updated that section of code with multi-byte string functions throughout. Version 1.5 has just been uploaded and should be available shortly.

    All the best,
    Greg

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic