dotCMS / dotCMS/core

Prevent creating folders with trailing "/"

Open
#34,894 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support stale Team : Maintenance
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

Creating folders with a trailing slash (e.g., test/) can cause significant issues if another folder with the same name is later created without it (e.g., test).

When this happens, both folders point to the same underlying assets and subfolders. Any modifications or deletions made through one folder will affect the other, since they share the same content.

Steps to Reproduce
  1. Navigate to Site Browser.
  2. Create a folder at the root level with test as the URI.
  3. Create a second folder at the root level with test/ as the URI.
  4. Add a subfolder named child under test.

Expected behavior: The child subfolder should only appear under test.

Actual behavior: The child subfolder also appears under test/. Deleting or modifying it from either location affects both, since the two folders share the same underlying content.

Acceptance Criteria
  • The system should not allow the creation of folders with a trailing slash in the URI.
  • An appropriate validation error should be displayed when a user attempts to create one.
  • Validation in place on both UI and API
dotCMS Version

trunk / 26.02.27-01_3d130b5

Severity

Medium - Some functionality impacted

Links

https://helpdesk.dotcms.com/a/tickets/34297

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through Site Browser using the listed steps, then trace folder creation in both the UI and API. Add validation that rejects folder URIs ending in a slash and verify that an appropriate error appears in both paths. Done means trailing-slash folders cannot be created through either interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, content, full-stack
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.