Problem/Motivation
I just came across a case in which an uploaded file had the same filename as a directory existing in the upload destination. This caused file_destination()
to rename the file, what again caused other troubles later in the upload process.
Proposed resolution
Extend the check file_exists()
, which returns TRUE
for folders, with an !is_dir()
check.
Remaining tasks
Reviews needed - is there a known case in which this behavior is required? As far as I know this functions is specific for files and thus really should ignore folders.
User interface changes
none
API changes
none - however this could change the behavior.
Attachment | Size | Status | Test result | Operations |
---|---|---|---|---|
drupal-file_destination-fails-if-directory-is-present.patch | 506 bytes | Test request sent | None | View details |