mirror of
https://github.com/nextcloud/server.git
synced 2026-03-06 15:31:07 -05:00
Merge pull request #47626 from nextcloud/backport/47546/stable30
This commit is contained in:
commit
791fc9d95a
2 changed files with 4 additions and 4 deletions
|
|
@ -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'));
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class PathVerificationTest extends \Test\TestCase {
|
|||
|
||||
public function testPathVerificationFileNameTooLong() {
|
||||
$this->expectException(\OCP\Files\InvalidPathException::class);
|
||||
$this->expectExceptionMessage('File name is too long');
|
||||
$this->expectExceptionMessage('Filename is too long');
|
||||
|
||||
$fileName = str_repeat('a', 500);
|
||||
$this->view->verifyPath('', $fileName);
|
||||
|
|
|
|||
Loading…
Reference in a new issue