mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Max file size of 100MB to prevent movie piracy
This commit is contained in:
parent
a397df8e1f
commit
9ec23e6d3f
1 changed files with 3 additions and 1 deletions
|
@ -60,6 +60,8 @@ class Site < Sequel::Model
|
||||||
SCREENSHOT_RESOLUTIONS = ['540x405', '210x158', '100x100', '50x50']
|
SCREENSHOT_RESOLUTIONS = ['540x405', '210x158', '100x100', '50x50']
|
||||||
THUMBNAIL_RESOLUTIONS = ['210x158']
|
THUMBNAIL_RESOLUTIONS = ['210x158']
|
||||||
|
|
||||||
|
MAX_FILE_SIZE = 10**8 # 100 MB
|
||||||
|
|
||||||
CLAMAV_THREAT_MATCHES = [
|
CLAMAV_THREAT_MATCHES = [
|
||||||
/^VBS/,
|
/^VBS/,
|
||||||
/^PUA\.Win32/,
|
/^PUA\.Win32/,
|
||||||
|
@ -911,7 +913,7 @@ class Site < Sequel::Model
|
||||||
end
|
end
|
||||||
|
|
||||||
def file_size_too_large?(size)
|
def file_size_too_large?(size)
|
||||||
return true if size + space_used > maximum_space
|
return true if size > MAX_FILE_SIZE || size + space_used > maximum_space
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue