mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: do not treat TIFF, BMP, WEBP as images
Treating TIFF and BMP as images cause us to add them to IMG tags, this is very inconsistent across browsers. You can still upload these files they will simply not be displayed in IMG tags.
This commit is contained in:
@ -204,16 +204,14 @@ QUnit.test("replaces GUID in image alt text on iOS", assert => {
|
||||
});
|
||||
|
||||
QUnit.test("isAnImage", assert => {
|
||||
["png", "jpg", "jpeg", "bmp", "gif", "tif", "tiff", "ico"].forEach(
|
||||
extension => {
|
||||
var image = "image." + extension;
|
||||
assert.ok(isAnImage(image), image + " is recognized as an image");
|
||||
assert.ok(
|
||||
isAnImage("http://foo.bar/path/to/" + image),
|
||||
image + " is recognized as an image"
|
||||
);
|
||||
}
|
||||
);
|
||||
["png", "jpg", "jpeg", "gif", "ico"].forEach(extension => {
|
||||
var image = "image." + extension;
|
||||
assert.ok(isAnImage(image), image + " is recognized as an image");
|
||||
assert.ok(
|
||||
isAnImage("http://foo.bar/path/to/" + image),
|
||||
image + " is recognized as an image"
|
||||
);
|
||||
});
|
||||
assert.not(isAnImage("file.txt"));
|
||||
assert.not(isAnImage("http://foo.bar/path/to/file.txt"));
|
||||
assert.not(isAnImage(""));
|
||||
|
Reference in New Issue
Block a user