Page MenuHomePhabricator

[PATCH] Existing images are overwritten without notice
Closed, ResolvedPublic

Description

Author: pcgod

Description:
If someone uploads an image which already exists, the old image is overwritten
without any logentry or history change if the user doesn't click the ReUpload button.

Reason:
The new image is saved with the same filename as the old image and the reupload
button restores it to the old version.

Possible Solutions:
1.) Save the image with a temporary name and rename it on confirm. (Would require a
maintainance script which removes old images)
2.) Restore the image on the next action of the user (Same problem as now if the user
does nothing after the warning)
3.) Let the user reupload the image when he accepts to overwrite the old image


Version: unspecified
Severity: major

Details

Reference
bz548

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 6:57 PM
bzimport set Reference to bz548.

pcgod wrote:

slightly tested patch which implements version 1 (diff against REL1_3)

Attached:

jeluf wrote:

Can't reproduce this any more. Has this been fixed in the meantime?

Bug confirmed still present in REL1_3 and HEAD.

I've made a somewhat more extensive reworking based on Benjamin's
patch. All 'warning'ed uploads are held in the temp dir until confirmed or
canceled. Also I fixed a logic error in the check for protected images,
moved some of the checks around, and generally did some clean-up.

While the situation with files getting left there if the user takes no action
is unsatisfying, it's actually the same as what the previous code did, only
now the garbage files are in a separate tree and no longer pollute the
main image file area. Future improvements are welcome, of course.

Fixed in HEAD, REL1_3, and live on Wiki*edia.

Gilles raised the priority of this task from High to Unbreak Now!.Dec 4 2014, 10:19 AM
Gilles added a project: Multimedia.
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to High.Dec 4 2014, 11:23 AM
epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:19 AM