Opened 2 years ago

Last modified 7 months ago

#17604 new defect (bug)

wp.uploadFile overwrite doesn't work

Reported by: M66B Owned by:
Priority: normal Milestone: Future Release
Component: XML-RPC Version: 3.2
Severity: normal Keywords: has-patch 3.6-early
Cc: marcel@…

Description

Removing the following lines from the function mw_newMediaObject file class-wp-xmlrpc-server.php solves the problem:

$filename = preg_replace('/^wpid\d+-/', '', $name);
$name = "wpid{$old_file->ID}-{$filename}";

Why are these lines there anyway? overwrite is overwrite.

This, presumably, bug exists in WP 3.1 too.

Attachments (1)

17604.diff (1.1 KB) - added by markoheijnen 8 months ago.
removes overwrite from mw_newMediaObject()

Download all attachments as: .zip

Change History (9)

comment:1   M66B2 years ago

  • Cc marcel@… added

comment:3 follow-up: ↓ 4   markoheijnen8 months ago

Can we remove this functionality. I don't get why it is in their the first place because it isn't something WordPress does by itself

comment:4 in reply to: ↑ 3   nacin8 months ago

Replying to markoheijnen:

Can we remove this functionality. I don't get why it is in their the first place because it isn't something WordPress does by itself

Works for me.

  • Milestone changed from Awaiting Review to 3.5

removes overwrite from mw_newMediaObject()

The patch removes overwrite functionality. Looked in to it more and it was never overwrite. It's more delete and upload a new one.

  • Keywords has-patch added
  • Keywords 3.6-early added
  • Milestone changed from 3.5 to Future Release
Note: See TracTickets for help on using tickets.