Эх сурвалжийг харах

Replace the &#39 with a single quote after getting it from the cache. And escape the back slashes.

Mark Crane 12 жил өмнө
parent
commit
88289280e3

+ 10 - 0
includes/install/scripts/xml_handler.lua

@@ -337,6 +337,9 @@
 							freeswitch.consoleLog("notice", "[xml_handler] sofia.conf source: database\n");
 						end
 				else
+					--replace the &#39 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 &#39 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 &#39 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");