I get above warning for some of my content. The problem happens in the trim() method:
|
public static function trim($string) |
|
{ |
|
return mb_ereg_replace('^\s*([\s\S]*?)\s*$', '\1', $string); |
|
} |
When the warning is throw, mb_ereg_replace will return false instead of a string, breaking the rest of the script.
I created a test case to demonstrate the problem: splitbrain-forks@914dd45
I have no idea why it fails. I'm also not 100% sure why a UTF-8 aware method is needed here. Is it to remove non-ASCII whitespaces like non-breaking or half-width spaces? Would using preg_replace with the /u flag be an alternative?