From 20ccc903505ee15419b5cde113f9061b7a4f7513 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 26 Aug 2014 11:02:16 +0800 Subject: [PATCH] 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 --- modules/luci-base/luasrc/http/protocol.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/luci-base/luasrc/http/protocol.lua b/modules/luci-base/luasrc/http/protocol.lua index 859272679..0cb62aeec 100644 --- a/modules/luci-base/luasrc/http/protocol.lua +++ b/modules/luci-base/luasrc/http/protocol.lua @@ -72,7 +72,7 @@ function urlencode( str ) if type(str) == "string" then str = str:gsub( - "([^a-zA-Z0-9$_%-%.!*'(),])", + "([^a-zA-Z0-9$_%-%.%~])", __chrenc ) end -- 2.11.0