跳至內容
主選單
主選單
移至側邊欄
隱藏
導覽
首頁
最近修改
新手使用指南
隨機頁面
貢獻分數
建立新頁面
工具
上傳檔案
特殊頁面
搜尋
搜尋
建立賬號
登入
個人工具
暗色模式
建立賬號
登入
用於已登出編輯者的頁面
了解更多
貢獻
討論
正在編輯
模組:Check for clobbered parameters
模組
討論
English
閱讀
編輯原始碼
檢視歷史
工具
工具
移至側邊欄
隱藏
操作
閱讀
編輯原始碼
檢視歷史
一般
連結至此的頁面
相關變更
特殊頁面
頁面資訊
取得短網址
警告:
您尚未登入。 若您進行任何的編輯您的 IP 位址將會被公開。 若您
登入
或
建立帳號
,您的編輯將會以您的使用者名稱標示,並能擁有另外的益處。
防垃圾訊息檢查用。
請勿
填寫此欄位!
local p = {} local function trim(s) return s:match('^%s*(.-)%s*$') end local function isnotempty(s) return s and s:match('%S') end function p.check(frame) local args = frame.args local pargs = frame:getParent().args local checknested = isnotempty(args['nested']) local delimiter = isnotempty(args['delimiter']) and args['delimiter'] or ';' local cat = '' if args['cat'] and mw.ustring.match(args['cat'],'^[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]:') then cat = args['cat'] end local res = '' local argpairs = {} for k, v in pairs(args) do if type(k) == 'number' then local plist = mw.text.split(v, delimiter) local pfound = {} local count = 0 for ii, vv in ipairs(plist) do vv = trim(vv) if checknested and pargs[vv] or isnotempty(pargs[vv]) then count = count + 1 table.insert(pfound, vv) end end if count > 1 then table.insert(argpairs, pfound) end end end local warnmsg = {} if #argpairs > 0 then for i, v in ipairs( argpairs ) do table.insert(warnmsg, '页面在以下列出的参数中使用了多过一个参数:<code>' .. table.concat(v, '</code>, <code>') .. '</code>') if cat ~= '' then res = res .. '[[' .. cat .. '|' .. (v[1] == '' and ' ' or '') .. v[1] .. ']]' end end end if #warnmsg > 0 then res = require('Module:If preview')._warning({ table.concat(warnmsg, '<br>') }) .. res end return res end return p
摘要:
請注意,所有於合眾百科 Unitedbook所做的貢獻會依據CC BY-NC-SA(創用CC 姓名標示─非商業性─相同方式分享)授權條款發佈(詳情請見
合眾百科:版權
)。若您不希望您的著作被任意修改與散佈,請勿在此發表文章。
您同時向我們保證在此的著作內容是您自行撰寫,或是取自不受版權保護的公開領域或自由資源。
請勿在未經授權的情況下發表文章!
取消
編輯說明
(在新視窗開啟)
此頁面使用了以下模板:
模組:Check for clobbered parameters/doc
(
編輯
)
切換限制內容寬度