From 634da03e676f6985e5e715bbf02f8252b06d994d Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 29 Nov 2012 22:16:16 +0000 Subject: [PATCH] Replace the ' with a single quote after getting it from the cache. And escape the back slashes. --- includes/install/scripts/xml_handler.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/install/scripts/xml_handler.lua b/includes/install/scripts/xml_handler.lua index 5c01d95bd0..40a445aa88 100644 --- a/includes/install/scripts/xml_handler.lua +++ b/includes/install/scripts/xml_handler.lua @@ -337,6 +337,9 @@ freeswitch.consoleLog("notice", "[xml_handler] sofia.conf source: database\n"); end else + --replace the ' back to a single quote + XML_STRING = XML_STRING:gsub("'", "'"); + --send to the console if (debug["cache"]) then freeswitch.consoleLog("notice", "[xml_handler] sofia.conf source: memcache\n"); @@ -439,6 +442,8 @@ if (XML_STRING == "-ERR NOT FOUND") then continue = true; else + --replace the ' back to a single quote + XML_STRING = XML_STRING:gsub("'", "'"); continue = false; end else @@ -920,6 +925,7 @@ XML_STRING = table.concat(xml, "\n"); --set the cache + XML_STRING = XML_STRING:gsub("\\\\\\%$", "\\\\\\\\\\%$"); result = trim(api:execute("memcache", "set " .. call_context .. " '"..XML_STRING:gsub("'", "'").."' "..expire["dialplan"])); --send the xml to the console @@ -934,6 +940,10 @@ freeswitch.consoleLog("notice", "[xml_handler] dialplan: "..call_context.." source: database\n"); end else + --replace the ' back to a single quote + XML_STRING = XML_STRING:gsub("'", "'"); + freeswitch.consoleLog("notice", "[xml_handler] dialplan: "..XML_STRING.."\n"); + --send to the console if (debug["cache"]) then freeswitch.consoleLog("notice", "[xml_handler] dialplan: "..call_context.." source: memcache\n");