Module:Utilities: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m url_encode fix, str instead of input
Sur (talk | contribs)
m url_encode fixed parameter not expecting frame
Line 72: Line 72:
--Much room for expansion here
--Much room for expansion here
function p.url_encode(str)
p.url_encode = function(frame)
local str = frame.args[1]
if (str == nil) then return "First parameter must be a string" end
-- Just replaces spaces with %20
-- Just replaces spaces with %20
return string.gsub(str, " ", "%%20")
return string.gsub(str, " ", "%%20")
end
end
return p
return p