Skip to:
Content
Pages
Categories
Search
Top
Bottom

unicode characters get corrupted or broken by ‘trim’ in bp-activity-templatetags.php

  • Avatar of kaberi
    kaberi
    Participant

    @kaberi

    If the ‘trim’ has been kept at a smaller value like 40, which it needs to be to have a good design and avoid too much length of the header area in profile page, unicode characters (some of those at random) get corrupted and show up as boxes if the entered text is much more than 40 words.

    The problem happens with in bp-activity-templatetags.php :
    trim( strip_tags( bp_create_excerpt( ….. 40
    Using rtrim or ltrim does not solve the problem.

    Incidentally, available information says
    ” ” If the 2nd argument is used, to extend the list of characters this functions attempt to trim, and multibyte characters are in the 2nd argument, then there is a risk of corrupting the returned subject string. This is because (l/r)trim will split the charlist into their component bytes and bytes in a multibyte sequence ” “

    If trim and strip tags are not done in the same go this MAY solve the problem, but HOW to do that? Please help.

You must be logged in to reply to this topic.