Changeset

629:6f9052edb18d

Second merge from waqas
author Matthew Wild <mwild1@gmail.com>
date Tue, 16 Dec 2008 02:40:50 +0000
parents 627:f0a4498ae996 (current diff) 628:3712d36b6d25 (diff)
children 630:e9336adb66e5
files
diffstat 4 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/net/http.lua	Tue Dec 16 02:40:29 2008 +0000
+++ b/net/http.lua	Tue Dec 16 02:40:50 2008 +0000
@@ -13,7 +13,7 @@
 local print = function () end
 
 local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end });
-local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
+local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end
 
 module "http"
 
--- a/prosody	Tue Dec 16 02:40:29 2008 +0000
+++ b/prosody	Tue Dec 16 02:40:50 2008 +0000
@@ -115,7 +115,7 @@
 	path = path:gsub("/", path_separator);
 	local x = io.popen("mkdir \""..path.."\" 2>&1"):read("*a");
 end
-function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
+function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end
 function mkdirs(host)
 	if not _mkdir[host] then
 		local host_dir = string.format("%s/%s", data_path, encode(host));
--- a/tools/ejabberd2prosody.lua	Tue Dec 16 02:40:29 2008 +0000
+++ b/tools/ejabberd2prosody.lua	Tue Dec 16 02:40:50 2008 +0000
@@ -37,7 +37,7 @@
 	--print("mkdir",path);
 	local x = io.popen("mkdir "..path.." 2>&1"):read("*a");
 end
-function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
+function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end
 function getpath(username, host, datastore, ext)
 	ext = ext or "dat";
 	if username then
--- a/util/datamanager.lua	Tue Dec 16 02:40:29 2008 +0000
+++ b/util/datamanager.lua	Tue Dec 16 02:40:50 2008 +0000
@@ -44,7 +44,7 @@
 	end
 
 	encode = function (s)
-		return s and (s:gsub("%W", function (c) return format("%%%x", c:byte()); end));
+		return s and (s:gsub("%W", function (c) return format("%%%02x", c:byte()); end));
 	end
 end