fixed offset calculation (bug #1961)

This commit is contained in:
Björn Schießle 2012-10-11 12:42:57 +02:00
parent 673e3dae3f
commit 4d451f649d

View file

@ -661,7 +661,7 @@ class OC_Helper {
$length = mb_strlen($search, $encoding); $length = mb_strlen($search, $encoding);
while(($i = mb_strrpos($subject, $search, $offset, $encoding)) !== false ) { while(($i = mb_strrpos($subject, $search, $offset, $encoding)) !== false ) {
$subject = OC_Helper::mb_substr_replace($subject, $replace, $i, $length); $subject = OC_Helper::mb_substr_replace($subject, $replace, $i, $length);
$offset = $i - mb_strlen($subject, $encoding) - 1; $offset = $i - mb_strlen($subject, $encoding);
$count++; $count++;
} }
return $subject; return $subject;