Fixed URL encoding to generate %0x instead of %x
[prosody.git] / util / datamanager.lua
index 6c9402c421c7659ab6f6bce1401780e701090dea..45da17ddfe6913562cbc32b00d1513df2a93cbad 100644 (file)
@@ -1,4 +1,4 @@
--- Prosody IM v0.1
+-- Prosody IM v0.2
 -- Copyright (C) 2008 Matthew Wild
 -- Copyright (C) 2008 Waqas Hussain
 -- 
@@ -44,7 +44,7 @@ do
        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
 
@@ -52,6 +52,7 @@ end
 
 local data_path = "data";
 function set_data_path(path)
+       log("info", "Setting data path to %s", path);
        data_path = path;
 end