mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 18:52:53 -04:00
Merge pull request #59566 from nextcloud/bugfix/noid/fix-reverting-multibyte-strings
fix(testing): Fix fake provider reverting strings with emojis
This commit is contained in:
commit
a2bb782f66
1 changed files with 9 additions and 1 deletions
|
|
@ -25,6 +25,14 @@ class FakeTranslationProvider implements ITranslationProvider {
|
|||
}
|
||||
|
||||
public function translate(?string $fromLanguage, string $toLanguage, string $text): string {
|
||||
return strrev($text);
|
||||
return $this->mb_strrev($text);
|
||||
}
|
||||
|
||||
protected function mb_strrev(string $str): string {
|
||||
$r = '';
|
||||
for ($i = mb_strlen($str); $i >= 0; $i--) {
|
||||
$r .= mb_substr($str, $i, 1);
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue