Closed (duplicate)
Project:
Drupal core
Version:
4.7.2
Component:
file system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2006 at 22:19 UTC
Updated:
14 Aug 2006 at 21:47 UTC
This problem has been discussed extensively (see "Flexinode Files getting .txt extensions added to them" and "why does it save in .txt?"). The modification necessary to solve this issue is contained in this patch.
| Comment | File | Size | Author |
|---|---|---|---|
| file.inc_4.patch | 1.06 KB | darren oh |
Comments
Comment #1
drummCommenting out code is not an acceptable substitute for removing it.
That particular code is there for security reasons. Uploaded files with certain extensions can be executed by some servers, so the extensions must be changed.
Comment #2
darren ohActually, this is not by design. It is the result of depending on an unreliable PHP feature.
Comment #3
darren ohAfter some more investigation, I found that file type detection was completely removed because it was not working reliably. See CVS commit 26881.
By the way, "all file extensions" includes .jpg, .html, .png, .pdf -- everything.
The problem is that PHP's file type checking never worked well, is no longer maintained, and will be replaced in the future. It has been deprecated and should not be used.
This problem was discussed in issue 43220 and the decision was made to remove file type checking until someone offered a better solution. However, the code that assigns the extension .txt to any undetected file type was not removed. I think it may have been overlooked, so I'm going to reopen the original issue and mark this one as a duplicate.