Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291614

file_destination() shouldn't rename the file if a directory with the same name exists.

$
0
0

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.

AttachmentSizeStatusTest resultOperations
drupal-file_destination-fails-if-directory-is-present.patch506 bytesTest request sentNoneView details

Viewing all articles
Browse latest Browse all 291614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>