mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
never allow any js that takes longer than 5 seconds to run.
This commit is contained in:
+2
-1
@@ -46,7 +46,8 @@ module PrettyText
|
||||
end
|
||||
|
||||
def self.create_new_context
|
||||
ctx = V8::Context.new
|
||||
# timeout any eval that takes longer that 5 seconds
|
||||
ctx = V8::Context.new(timeout: 5000)
|
||||
|
||||
ctx["helpers"] = Helpers.new
|
||||
|
||||
|
||||
Reference in New Issue
Block a user