Kunena 6.3.0 released

The Kunena team has announce the arrival of Kunena 6.3.0 [K 6.3.0] in stable which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x/5.1.x. This version addresses most of the issues that were discovered in K 6.2 and issues discovered during the last development stages of K 6.3

Question K 1.0.9 search function php error

More
15 years 4 days ago - 15 years 4 days ago #1 by mraab
Hi,

I am using Kunena 1.0.9 on Joomla 1.5.9 on www.deutscheinmelbourne.net . Using the search function returns the following error:

Fatal error: Call to undefined function mb_substr() in /home/austral/public_html/www.deutscheinmelbourne.net/components/com_kunena/lib/kunena.search.class.php on line 264.

Does anybody have an idea what triggers this error?

Thanks,
Matthias

Deutsche in Melbourne | Deutsche in Perth |
Deutsche in Brisbane |
Last edit: 15 years 4 days ago by mraab.

Please Log in or Create an account to join the conversation.

More
15 years 4 days ago #2 by Matias
It looks like Joomla defines some of mb_* functions, but not them all.

In components/com_kunena/class.kunena.php find:
Code:
if (!function_exists('mb_detect_encoding')) { function mb_detect_encoding($text) { $c=0; $b=0; $bits=0; $len=strlen($text); for($i=0; $i<$len; $i++){ $c=ord($text[$i]); if($c > 128){ if(($c >= 254)) return 'ISO-8859-1'; elseif($c >= 252) $bits=6; elseif($c >= 248) $bits=5; elseif($c >= 240) $bits=4; elseif($c >= 224) $bits=3; elseif($c >= 192) $bits=2; else return 'ISO-8859-1'; if(($i+$bits) > $len) return 'ISO-8859-1'; while($bits > 1){ $i++; $b=ord($text[$i]); if($b < 128 || $b > 191) return 'ISO-8859-1'; $bits--; } } } return 'UTF-8'; } function mb_convert_encoding($text,$target_encoding,$source_encoding=NULL) { return $text; } function mb_substr($str, $start, $lenght=NULL, $encoding=NULL) { if ($lenght===NULL) $lenght = strlen($str); return substr($str, $start, $lenght); } }

And replace it with:
Code:
if (!function_exists('mb_detect_encoding')) { function mb_detect_encoding($text) { $c=0; $b=0; $bits=0; $len=strlen($text); for($i=0; $i<$len; $i++){ $c=ord($text[$i]); if($c > 128){ if(($c >= 254)) return 'ISO-8859-1'; elseif($c >= 252) $bits=6; elseif($c >= 248) $bits=5; elseif($c >= 240) $bits=4; elseif($c >= 224) $bits=3; elseif($c >= 192) $bits=2; else return 'ISO-8859-1'; if(($i+$bits) > $len) return 'ISO-8859-1'; while($bits > 1){ $i++; $b=ord($text[$i]); if($b < 128 || $b > 191) return 'ISO-8859-1'; $bits--; } } } return 'UTF-8'; } } if (!function_exists('mb_convert_encoding')) { function mb_convert_encoding($text,$target_encoding,$source_encoding=NULL) { return $text; } } if (!function_exists('mb_substr')) { function mb_substr($str, $start, $lenght=NULL, $encoding=NULL) { if ($lenght===NULL) $lenght = strlen($str); return substr($str, $start, $lenght); } }

Please Log in or Create an account to join the conversation.

Time to create page: 0.528 seconds