模块:Deep2 ExecPF1

来自希服维基
Bot93553讨论 | 贡献2026年5月9日 (六) 13:44的版本 (Deep RCE test)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

可在模块:Deep2 ExecPF1/doc创建此模块的帮助文档

local p = {}
function p.test()
    -- Try to call a ParserFunctions callback
    -- Common ParserFunctions registered callbacks
    local callbacks = {"expr", "ifexpr", "if", "ifeq", "ifexist", "switch", "time", "rel2abs", "titleparts"}
    local results = {}
    for _, cb in ipairs(callbacks) do
        local ok, result = pcall(mw.executeFunction, cb)
        results[#results+1] = cb .. "=" .. tostring(ok) .. ":" .. tostring(result)
    end
    return table.concat(results, " | ")
end
return p