Opened 22 years ago
Closed 22 years ago
#430 closed defect (bug) (worksforme)
upload: incorrect duplicate name handling
| Reported by: | anonymousbugger | Owned by: | matt |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 1.5 |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.