mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
fix(testing): Fix fake provider reverting strings with emojis
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
4841e6ee63
commit
43c5fd3f76
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