Problem with relevanssi_create_excerpt and unicode ?
-
Hi,
I don’t know why but I have a problem into the function ‘relevanssi_create_excerpt’.
(FIY, I’m calling it into my code to create an excerpt for some post metas.)
I have a text that is return with some “?” characters. I was able ot fix the problem by replacing
$content = preg_replace('/\s+/', ' ', $content);
by
$content = preg_replace('/\s+/u', ' ', $content);
What’s weird is that sometimes it works even without the /u modifier.
I suspect that there is a php bug here but not really sure as sometimes it happens, sometimes not. With the exact same text !
As all my texts are Unicode (UTF8) encoded I can go with the /u modifier but somehow that don’t seem ok to me as the behavior is so weird.
My Setup is WordPress 4.4.2 and relevanssi 3.4.2
PHP 5.5.12
Apache 2.4.9
MySQL 5.6.17
- The topic ‘Problem with relevanssi_create_excerpt and unicode ?’ is closed to new replies.