From 177a08af91c2094dd76366907f4b424c30daba03 Mon Sep 17 00:00:00 2001 From: midoks Date: Sun, 12 Feb 2023 02:12:34 +0800 Subject: [PATCH] Update waf_common.lua --- plugins/op_waf/waf/lua/waf_common.lua | 6 ++++++ 1 file changed, 6 insertions(+) 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