Skip to content

Support absolute filesystem paths in setUploadDir()#7578

Open
lacatoire wants to merge 2 commits intoEasyCorp:5.xfrom
lacatoire:fix/7459-absolute-upload-dir
Open

Support absolute filesystem paths in setUploadDir()#7578
lacatoire wants to merge 2 commits intoEasyCorp:5.xfrom
lacatoire:fix/7459-absolute-upload-dir

Conversation

@lacatoire
Copy link
Copy Markdown
Contributor

ImageField::setUploadDir() and FileField::setUploadDir() currently strip any leading directory separator, so true absolute paths like /mnt/data/uploads/ are silently rewritten to <project-dir>/mnt/data/uploads/.

This change detects absolute filesystem paths before the existing relative-path normalization, and uses them as-is, while preserving the current behavior for relative paths and stream wrappers.

Fixes #7459

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow absolute filesystem paths in ImageField::setUploadDir()

1 participant