Skip to content
Snippets Groups Projects
Commit 2570ea71 authored by Björn Schießle's avatar Björn Schießle
Browse files

don't interpret strpos '0' as 'false' in while loop

parent dc0dc56d
Branches
No related tags found
No related merge requests found
......@@ -657,7 +657,7 @@ class OC_Helper {
public static function mb_str_replace($search, $replace, $subject, $encoding = 'UTF-8', &$count = null) {
$offset = -1;
$length = mb_strlen($search, $encoding);
while(($i = mb_strrpos($subject, $search, $offset, $encoding))) {
while(($i = mb_strrpos($subject, $search, $offset, $encoding)) !== false ) {
$subject = OC_Helper::mb_substr_replace($subject, $replace, $i, $length);
$offset = $i - mb_strlen($subject, $encoding) - 1;
$count++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment