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

Upload Track button not working
  • 9 replies
Hallo, I have a problem uploading new gps tracks. Clicking on the...

Latest questions
  • 1 reply
I am trying to recreate the very slim (just a header and topic...

Owner
  • 1 reply
I only have two questions per survey. Is it possible to place them...

GPS TOOLS v5.1.1 : IMPOSSIBLE TO CREATE TRACK
  • 1 reply
Hi Maverick, IMPORTANT ISSUE : After installing v5.1.1, it's...

Import Wordpress posts
  • 1 reply
Is there a migrator to do this? I have a site with nearly 600 posts...

Subscribe Newsletter