mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: make sure pasting an image in the composer is considered as an image instead of an attachment
This commit is contained in:
@@ -162,11 +162,12 @@ Discourse.Utilities = {
|
||||
}
|
||||
|
||||
var upload = files[0];
|
||||
var type = Discourse.Utilities.isAnImage(upload.name) ? 'image' : 'attachment';
|
||||
|
||||
// CHROME ONLY: if the image was pasted, sets its name to a default one
|
||||
if (upload instanceof Blob && !(upload instanceof File) && upload.type === "image/png") { upload.name = "blob.png"; }
|
||||
|
||||
var type = Discourse.Utilities.isAnImage(upload.name) ? 'image' : 'attachment';
|
||||
|
||||
return Discourse.Utilities.validateUploadedFile(upload, type, bypassNewUserRestriction);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user