Require period in image/video filename.

This commit is contained in:
ccd0 2019-08-04 20:12:09 -07:00
parent 2b52a66550
commit 46fb24219b

View File

@ -198,8 +198,8 @@ class Post
$.extend file,
url: file.link.href
isImage: /(jpe?g|png|gif|bmp)$/i.test file.link.href
isVideo: /(webm|mp4)$/i.test file.link.href
isImage: /\.(jpe?g|png|gif|bmp)$/i.test file.link.href
isVideo: /\.(webm|mp4)$/i.test file.link.href
size = +file.size.match(/[\d.]+/)[0]
unit = ['B', 'KB', 'MB', 'GB'].indexOf file.size.match(/\w+$/)[0]
size *= 1024 while unit-- > 0