Content deleted Content added
simplify and fix pageid passing |
return error msg if title:field fails instead of passing "" for all parameters by default as untended results can happen |
||
Line 24:
local interwiki=args.interwiki or pargs.interwiki or "";
local nowiki=args.nowiki or pargs.nowiki or false;
local page=args.page or args[1] or pargs.page or pargs[1] or "";
local id= tonumber( args.id or pargs.id );
local pn = {
local title -- holds the result of the mw.title.xxx call
for i = 1,9 do pn[i] = args['p'..i] or pargs['p'..i]
if not id and not mw.ustring.match( page, '%S' ) then page = nil; end
Line 48:
end
local result, success = title[field];
if type(result) == "function" then
success, result =
if
return mw.
return tostring(result);▼
end
end
if nowiki and result ~= nil then
else
return tostring(result or "");
|