diff options
author | Joas Schilling <coding@schilljs.com> | 2021-03-30 20:19:41 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-04-20 16:42:04 +0200 |
commit | a4c6749b020d5cb4e63a54b0aa9ca5ebe961ee4d (patch) | |
tree | 5bd5a342cec2acbac1e09558cdd96c2c921c6391 /lib/private/L10N | |
parent | 157147cb8eaa1800a8473db547c6964a5205e83d (diff) | |
download | nextcloud-server-a4c6749b020d5cb4e63a54b0aa9ca5ebe961ee4d.tar.gz nextcloud-server-a4c6749b020d5cb4e63a54b0aa9ca5ebe961ee4d.zip |
Add a check for the pipe character
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/L10N')
-rw-r--r-- | lib/private/L10N/L10NString.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/L10N/L10NString.php b/lib/private/L10N/L10NString.php index 0eadadf9be1..ae90f52a02d 100644 --- a/lib/private/L10N/L10NString.php +++ b/lib/private/L10N/L10NString.php @@ -59,6 +59,12 @@ class L10NString implements \JsonSerializable { public function __toString(): string { $translations = $this->l10n->getTranslations(); + + $pipeCheck = implode('', $translations[$this->text]); + if (strpos($pipeCheck, '|') !== false) { + return 'Can not use pipe character in translations'; + } + $identityTranslator = $this->l10n->getIdentityTranslator(); $parameters = $this->parameters; |