mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +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:
parent
84a10f8212
commit
c50db76f5d
6 changed files with 18 additions and 23 deletions
|
@ -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(""));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue