Welcome to Geeklog, Anonymous Friday, October 11 2024 @ 10:55 pm EDT

Geeklog Forums

substr


Status: offline

berber

Forum User
Junior
Registered: 10/24/05
Posts: 20
Hi

I tried to fill in a bug report but got an 404 not found page from your main page on the left.

I wanted to update you that I'm using Geeklog in Hebrew (UTFCool and I had a problem with the latest comments in the last 48 hours. I tracked the problem down to PHPs substr not supporting UTF8.

I changed in lib-common the substr in COM_whatsNewBlock to

Text Formatted Code
function utf8_substr($str,$from,$len){
        return preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'. '((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s','$1',$str);
}
 


and it works well now.

Please advise.
 Quote

All times are EDT. The time is now 10:55 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content