Make WordPress Core

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)

#2 @matt
22 years ago

  • Owner changed from anonymous to matt
  • Resolution 1020
  • Status newclosed

#3 @matt
22 years ago

  • PatchNo
  • Version 1.21.5

#4 @anonymousbugger
22 years ago

  • Patch NoYes
  • Resolution 2030
  • Status closedassigned

#5 @anonymousbugger
22 years ago

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.

#6 @matt
22 years ago

  • Resolution 3040
  • Status assignedclosed
Note: See TracTickets for help on using tickets.