1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

UTF-8 aware text truncate

This commit is contained in:
SecretR
2013-10-09 09:31:24 +03:00
parent e3c7337c64
commit d5f9c298c3

View File

@@ -1207,10 +1207,10 @@ class e_parse extends e_parser
// it should work for any characters encoding // it should work for any characters encoding
// FIXME - INVESTIGATE this one, switch to utf8 aware methods // FIXME - INVESTIGATE this one, switch to utf8 aware methods
$leftAmp = strrpos(substr($ret, -8), '&'); $leftAmp = $this->ustrrpos($this->usubstr($ret, -8), '&');
if($leftAmp) if($leftAmp)
{ {
$ret = substr($ret, 0, strlen($ret) - 8 + $leftAmp); $ret = $this->usubstr($ret, 0, $this->ustrlen($ret) - 8 + $leftAmp);
} }
return $ret.$more; return $ret.$more;