Opened 21 years ago
Closed 21 years ago
#430 closed defect (bug) (worksforme)
upload: incorrect duplicate name handling
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | minor | Version: | 1.5 |
| Component: | Administration | Keywords: | |
| Focuses: | Cc: |
Description
In the file upload.php, there is a part that checks for duplicate filenames, and if so 'computes' a new name. What is the problem:
$filetype is the lowercased extension of the file, eg "jpg", but the real filename might be JPG. If this is the case, the line
$pos = strpos($tmppathtofile, '.'.trim($imgtype));
will return false.
The solution is
$pos = strpos(strtolower($tmppathtofile), '.'.trim($imgtype));
This all happens around line 115 of file upload.php in directory wp-admin.
Change History (6)
Note: See
TracTickets for help on using
tickets.
This isn't the correct way to go about this; on *nix systems, filenames are case-sensitive. foo.jpg and foo.JPG are different files.