User "Raindrift" posted a comment on MediaWiki.r92200.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/92200#c20834
Commit summary:

fixed a condition where re-uploading a file that's already stashed causes 
breakage.  This mirrors the previous session-based behavior as closely as 
possible.

Comment:

My code generates the key for all the use cases in UW.  The key is guaranteed 
unique, and I'm not concerned about a race condition there.  I wrote this code 
when that wasn't true.

However, it's possible to pass in a key from elsewhere.  That is, I don't have 
any guarantee that this key will be unique at all, since I'm not always 
generating it.  For example, if the externally-generated key is based on the 
local filename, collisions could arise.  Since the key is always owned by the 
uploading user, it seemed almost certain that a key collision would mean a 
newer version of the file, which is why the default is to overwrite.

I'd be down to remove all this code, though, as long as I also remove the $key 
param from UploadStash::stashFile().  I'm concerned that doing so might break 
something external somewhere, though, which is why I left it alone.


_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to