Module:Utilities: Difference between revisionsGive feedback
m url_encode fix, str instead of input |
m url_encode fixed parameter not expecting frame |
||
| Line 72: | Line 72: | ||
--Much room for expansion here | --Much room for expansion here | ||
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 | ||