diff --git a/plugins/op_waf/waf/lua/waf_common.lua b/plugins/op_waf/waf/lua/waf_common.lua index 10f254987..21007a5fc 100644 --- a/plugins/op_waf/waf/lua/waf_common.lua +++ b/plugins/op_waf/waf/lua/waf_common.lua @@ -390,6 +390,12 @@ function _M.read_file(self, name) return data end +function _M.file_exists(self,path) + local file = io.open(path, "rb") + if file then file:close() end + return file ~= nil +end + function _M.select_rule(self, rules) if not rules then return {} end