All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Fatal error: Call to undefined function mb_strlen()

Casey Reid 17 Feb 2012 20:26 problem, complete

When performing a search in one of our development environments, we get the following error.

Fatal error: Call to undefined function mb_strlen() in /html/third_party/low_search/mod.low_search.php on line 519

This particular environment is running PHP 5.2.9. This issue does not occur on another environment running PHP 5.3.6.

Changing mb_stren() in that line to strlen() fixes the issue and the search then works fine. Is there a benefit to using one over the other? We are hesitant to change the add-on code for update reasons down the line, but will do so if that is the recommended option for now.

Thanks!

Replies

  1. Low 19 Feb 2012 14:57

    Hi Casey,

    This problem has come to my attention before and is fixed for the next version. It has to do with the the multibyte package being installed with PHP or not. There's no harm in changing mb_strlen() to strlen() -- that's part of the fix coming in the next version.

  2. Casey Reid 20 Feb 2012 19:51

    Sounds good. Thanks for resolving the issue!

  3. james.spibey 2 Jun 2012 06:39

    Hey

    Just a note to say this bug is still in 2.0.1. Can it be fixed for the next version please?

    Thanks

    James

  4. Low 2 Jun 2012 07:30

    Hi James,

    Are you sure? In 2.0.1, line #476 of mod.low_search.php says this:

    $word_length = function_exists('mb_strlen') ? mb_strlen($word) : strlen($word);


    ...which should be the workaround. Are you getting the exact same error?

  5. james.spibey 2 Jun 2012 07:36

    I just downloaded 2.0.1 from devotee to make sure, on line 476 I have this

    if (mb_strlen($word) < $ext['min_word_length'] OR in_array($word, $stop_words))

  6. Low 2 Jun 2012 07:44

    I've re-uploaded the package to Devot:ee. Can you try and download again and replace the file?

  7. james.spibey 2 Jun 2012 08:00

    Yeah, that's fixed it. Thanks for the quick response