diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2024-08-29 23:28:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-29 23:28:50 +0200 |
commit | bfb583575034c47fc82d858b62fff42f6971bb92 (patch) | |
tree | f17bf1392686a27ab6e677af59bcaa384ca34536 /lib/private/Files/View.php | |
parent | 12dcc0bf58306bdf6f22d7079f539c4dd1028a3c (diff) | |
parent | 81c6c24cd5995addd5407ff7ca4d886c7f931b32 (diff) | |
download | nextcloud-server-bfb583575034c47fc82d858b62fff42f6971bb92.tar.gz nextcloud-server-bfb583575034c47fc82d858b62fff42f6971bb92.zip |
Merge pull request #47546 from nextcloud/fix/files-view-error-messages
fix: Adjust filename validation messages
Diffstat (limited to 'lib/private/Files/View.php')
-rw-r--r-- | lib/private/Files/View.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index e0416d9051d..64c7f744dd9 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1852,13 +1852,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')); |