From 7e2fe95d2f2e86a4ff8771b9c94fcaaa56e0043a Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 2 Oct 2024 15:02:23 +0200 Subject: [PATCH] Restrict shortcut name (#11707) * Restrict shortcut name * Add changelog item --- .../bugfix-prevent-not-allowed-characters-in-shortcut-name | 7 +++++++ packages/web-pkg/src/components/CreateShortcutModal.vue | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 changelog/unreleased/bugfix-prevent-not-allowed-characters-in-shortcut-name diff --git a/changelog/unreleased/bugfix-prevent-not-allowed-characters-in-shortcut-name b/changelog/unreleased/bugfix-prevent-not-allowed-characters-in-shortcut-name new file mode 100644 index 00000000000..7afefcaa69a --- /dev/null +++ b/changelog/unreleased/bugfix-prevent-not-allowed-characters-in-shortcut-name @@ -0,0 +1,7 @@ +Bugfix: Prevent not allowed characters in shortcut name + +We've fixed an issue where not allowed characters were allowed in the shortcut name. +Now, the shortcut name will be validated and only allowed characters will be accepted. + +https://github.com/owncloud/web/pull/11707 +https://github.com/owncloud/web/issues/11702 diff --git a/packages/web-pkg/src/components/CreateShortcutModal.vue b/packages/web-pkg/src/components/CreateShortcutModal.vue index 4f55fc59152..0569c4659f0 100644 --- a/packages/web-pkg/src/components/CreateShortcutModal.vue +++ b/packages/web-pkg/src/components/CreateShortcutModal.vue @@ -213,6 +213,10 @@ export default defineComponent({ return $gettext('%{name} already exists', { name: `${unref(inputFilename)}.url` }) } + if (/[/]/.test(unref(inputFilename))) { + return $gettext('Shortcut name cannot contain "/"') + } + return '' })