I just paid for the membership and installed this on Joomla 2.5 and am getting the following error:

Fatal error: Call to undefined function mb_strlen() in /home/networkw/public_html/components/com_cjlib/framework/functions.php on line 656

this happens when:
- I try to submit a poll from the front end
- I click on a poll

Interestingly enough the Random Poll works and doesn't get this error but pretty much doing anything else does.

I've tried completely uninstalling and reinstalling, rebooting the server, and testing from various machines with the same results.

Please help!


Like it on Facebook, Tweet it or share this topic on other bookmarking websites.
  • Re: Fatal error: Call to undefined function mb_strlen

    by » 9 years ago

    mb_strlen is used to correctly calculate string length of utf characters. Most reputed and good hosts enable it by default in php. Anyway since it doesn't looks to be installed on your website follow the below quick fix (recommended to enable mbstring in your php, contact your webhost if you do not know how to).

    edit components/com_cjlib/framework/functions.php

    find in function substrws
    		if( (mb_strlen($text, 'UTF-8') > $len) ) {

    $whitespaceposition = mb_strpos($text, ' ', $len, 'UTF-8')-1;

    if( $whitespaceposition > 0 ) {

    $chars = count_chars(mb_substr($text, 0, $whitespaceposition + 1, 'UTF-8'), 1);

    if ($chars[ord('<')] > $chars[ord('>')]){

    $whitespaceposition = mb_strpos($text, '>', $whitespaceposition, 'UTF-8') - 1;

    $text = mb_substr($text, 0, $whitespaceposition + 1, 'UTF-8');

    replace it with
    		if( (strlen($text) > $len) ) {

    $whitespaceposition = strpos($text, ' ', $len)-1;

    if( $whitespaceposition > 0 ) {

    $chars = count_chars(substr($text, 0, $whitespaceposition + 1), 1);

    if ($chars[ord('<')] > $chars[ord('>')]){

    $whitespaceposition = strpos($text, '>', $whitespaceposition) - 1;

    $text = substr($text, 0, $whitespaceposition + 1);

    Follow me on twitter: https://twitter.com/corejoomla
    If you use our extensions, please post a rating and a review at the Joomla! Extensions Directory.
    Sociable | Surveys | 
    CjForum | Polls | Answers | Quizzes | Quotes | GPS Tools

You do not have permissions to reply to this topic.
Powered by CjForum