Module:Utilities: Difference between revisions

Sur (talk | contribs)
m url_encode fix, returning both values from gsub instead of just resulting string
Sur (talk | contribs)
m url_encode now usable both internally and externally
Line 72: Line 72:
--Much room for expansion here
--Much room for expansion here
p.url_encode = function(frame)
p.url_encode = function(str)
local str = frame.args[1]
if type(str) == 'table' and str.args then
frame = str
str = frame.args[1]
end
if (str == nil) then return "First parameter must be a string" end
if (str == nil) then return "First parameter must be a string" end
-- Just replaces spaces with %20
-- Just replaces spaces with %20