mod_muc_log_http: use datamanager's encoding function to encode room names.
--- a/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Sun Apr 07 14:24:13 2013 +0200
+++ b/mod_muc_log_http/muc_log_http/mod_muc_log_http.lua Sun Apr 07 19:03:55 2013 +0200
@@ -9,7 +9,6 @@
local strformat = string.format;
local splitJid = require "util.jid".split;
local config_get = require "core.configmanager".get;
-local urlencode = require "net.http".urlencode;
local urldecode = require "net.http".urldecode;
local http_event = require "net.http.server".fire_event;
local data_load, data_getpath = datamanager.load, datamanager.getpath;
@@ -28,6 +27,9 @@
local html = {};
local theme;
+-- encoding function
+local p_encode = datamanager.path_encode;
+
local function checkDatastorePathExists(node, host, today, create)
create = create or false;
local path = data_getpath(node, host, datastore, "dat", true);
@@ -213,7 +215,7 @@
year = year - 2000;
end
local bareDay = str_format("20%.02d-%.02d-%.02d", year, month, day);
- room = urlencode(room);
+ room = p_encode(room);
local attributes, err = lfs.attributes(path.."/"..str_format("%.02d%.02d%.02d", year, month, day).."/"..room..".dat")
if attributes ~= nil and attributes.mode == "file" then
local s = html.days.bit;