Diff

tools/ejabberd2prosody.lua @ 628:3712d36b6d25

Fixed URL encoding to generate %0x instead of %x
author Waqas Hussain <waqas20@gmail.com>
date Tue, 16 Dec 2008 03:46:17 +0500
parent 615:4ae3e81513f3
child 643:8ff454831f7d
line wrap: on
line diff
--- a/tools/ejabberd2prosody.lua	Sat Dec 13 17:43:52 2008 +0000
+++ b/tools/ejabberd2prosody.lua	Tue Dec 16 03:46:17 2008 +0500
@@ -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