From 81c6c24cd5995addd5407ff7ca4d886c7f931b32 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 27 Aug 2024 19:42:00 +0200 Subject: fix: Adjust filename validation messages Signed-off-by: Ferdinand Thiessen --- lib/private/Files/View.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/private/Files/View.php') diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 494b4493d2c..b35912c1f7e 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1841,13 +1841,13 @@ class View { $storage->verifyPath($internalPath, $fileName); } catch (ReservedWordException $ex) { $l = \OCP\Util::getL10N('lib'); - throw new InvalidPathException($l->t('File name is a reserved word')); + throw new InvalidPathException($ex->getMessage() ?: $l->t('Filename is a reserved word')); } catch (InvalidCharacterInPathException $ex) { $l = \OCP\Util::getL10N('lib'); - throw new InvalidPathException($l->t('File name contains at least one invalid character')); + throw new InvalidPathException($ex->getMessage() ?: $l->t('Filename contains at least one invalid character')); } catch (FileNameTooLongException $ex) { $l = \OCP\Util::getL10N('lib'); - throw new InvalidPathException($l->t('File name is too long')); + throw new InvalidPathException($l->t('Filename is too long')); } catch (InvalidDirectoryException $ex) { $l = \OCP\Util::getL10N('lib'); throw new InvalidPathException($l->t('Dot files are not allowed')); -- cgit v1.2.3