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!

Thanks,

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

    by » 7 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.
    CjFitCjForum | Polls | Answers | Quizzes | Quotes | Surveys | GPS Tools | CjBlog


You do not have permissions to reply to this topic.

Powered by CjForum

Site Search

Trending Topics

Search not working
  • 3 replies
Hallo, I wonder why the track search is not working... here my...

Getting Started
  • 1 reply
Please direct me to the instructions on how to use Sociable.

Spanish Language Localization not working?
  • 3 replies
I think I added the Spanish language front end/back end translation...

Is there a way to not display the Navbar Survey Button
  • 2 replies
As the title - my surveys will be standalone so there is no need to...

Can the Respondent Select Language?
  • 2 replies
I have translated the survey (nice feature!). I see that I can add...

Subscribe Newsletter