Fatal error: Call to undefined function mb_strlen()
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
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.
Casey Reid 20 Feb 2012 19:51
Sounds good. Thanks for resolving the issue!
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
Low 2 Jun 2012 07:30
Hi James,
Are you sure? In 2.0.1, line #476 of mod.low_search.php says this:
...which should be the workaround. Are you getting the exact same error?
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))
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?
james.spibey 2 Jun 2012 08:00
Yeah, that's fixed it. Thanks for the quick response