summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2014-08-26 11:02:16 +0800
committerYousong Zhou <yszhou4tech@gmail.com>2015-11-03 17:07:45 +0800
commit20ccc903505ee15419b5cde113f9061b7a4f7513 (patch)
tree01c329763c874872d9882e5cdc26d01645d8f1f5 /modules
parent20851933bf31579be72cf593a22e00e33ee9105b (diff)
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>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-base/luasrc/http/protocol.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/http/protocol.lua b/modules/luci-base/luasrc/http/protocol.lua
index 859272679f..0cb62aeec9 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