diff --git a/changelog/unreleased/bugfix-keep-both-conflict b/changelog/unreleased/bugfix-keep-both-conflict new file mode 100644 index 00000000000..471cc16accf --- /dev/null +++ b/changelog/unreleased/bugfix-keep-both-conflict @@ -0,0 +1,6 @@ +Bugfix: Keep both folders conflict in same-named folders + +Parsing has been adjusted to account for edge case of multiple folders and sub-folders with the same name + +https://github.com/owncloud/web/pull/9915 +https://github.com/owncloud/web/issues/9158 diff --git a/packages/web-app-files/src/helpers/resource/actions/upload.ts b/packages/web-app-files/src/helpers/resource/actions/upload.ts index ca5ba682a89..39274f62ea9 100644 --- a/packages/web-app-files/src/helpers/resource/actions/upload.ts +++ b/packages/web-app-files/src/helpers/resource/actions/upload.ts @@ -165,18 +165,18 @@ export class ResourceConflict extends ConflictDialog { `/${newFolderName}/` ) file.meta.tusEndpoint = file.meta.tusEndpoint.replace( - new RegExp(`/${encodeURIComponent(folder)}`), + new RegExp(`/${encodeURIComponent(folder)}$`), `/${encodeURIComponent(newFolderName)}` ) if (file.xhrUpload?.endpoint) { file.xhrUpload.endpoint = file.xhrUpload.endpoint.replace( - new RegExp(`/${encodeURIComponent(folder)}`), + new RegExp(`/${encodeURIComponent(folder)}$`), `/${encodeURIComponent(newFolderName)}` ) } if (file.tus?.endpoint) { file.tus.endpoint = file.tus.endpoint.replace( - new RegExp(`/${encodeURIComponent(folder)}`), + new RegExp(`/${encodeURIComponent(folder)}$`), `/${encodeURIComponent(newFolderName)}` ) }