openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #13591
[Merge] lp:~mahfiaz/openlp/bug-354 into lp:openlp
mahfiaz has proposed merging lp:~mahfiaz/openlp/bug-354 into lp:openlp.
Requested reviews:
Jonathan Corwin (j-corwin)
For more details, see:
https://code.launchpad.net/~mahfiaz/openlp/bug-354/+merge/86815
Fix for #354. Javascript generated buggy JSON in remote when sending alert.
--
https://code.launchpad.net/~mahfiaz/openlp/bug-354/+merge/86815
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/remotes/html/openlp.js'
--- openlp/plugins/remotes/html/openlp.js 2011-12-21 08:15:07 +0000
+++ openlp/plugins/remotes/html/openlp.js 2011-12-23 15:49:28 +0000
@@ -208,7 +208,9 @@
},
showAlert: function (event) {
event.preventDefault();
- var text = "{\"request\": {\"text\": " + $("#alert-text").val() + "}}";
+ var text = "{\"request\": {\"text\": \"" +
+ $("#alert-text").val().replace(/\\/g, "\\\\").replace(/"/g, "\\\"") +
+ "\"}}";
$.getJSON(
"/api/alert",
{"data": text},
@@ -219,7 +221,9 @@
},
search: function (event) {
event.preventDefault();
- var text = "{\"request\": {\"text\": \"" + $("#search-text").val() + "\"}}";
+ var text = "{\"request\": {\"text\": \"" +
+ $("#search-text").val().replace("\\", "\\\\").replace("\"", "\\\"") +
+ "\"}}";
$.getJSON(
"/api/" + $("#search-plugin").val() + "/search",
{"data": text},