mirror of https://github.com/openwrt/luci.git
luci-base: urlencode: encode all except unreserved characters.
As per http://tools.ietf.org/html/rfc3986#section-2.3 Characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>pull/534/head
parent
20851933bf
commit
20ccc90350
|
@ -72,7 +72,7 @@ function urlencode( str )
|
||||||
|
|
||||||
if type(str) == "string" then
|
if type(str) == "string" then
|
||||||
str = str:gsub(
|
str = str:gsub(
|
||||||
"([^a-zA-Z0-9$_%-%.!*'(),])",
|
"([^a-zA-Z0-9$_%-%.%~])",
|
||||||
__chrenc
|
__chrenc
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue