Made search function's replace greedy as well. Thanks to gushie the world is better place now :).

This commit is contained in:
Mattias Põldaru 2011-12-23 18:03:37 +02:00
parent 514773abe8
commit 173915f956
1 changed files with 1 additions and 1 deletions

View File

@ -222,7 +222,7 @@ window.OpenLP = {
search: function (event) { search: function (event) {
event.preventDefault(); event.preventDefault();
var text = "{\"request\": {\"text\": \"" + var text = "{\"request\": {\"text\": \"" +
$("#search-text").val().replace("\\", "\\\\").replace("\"", "\\\"") + $("#search-text").val().replace(/\\/g, "\\\\").replace(/"/g, "\\\"") +
"\"}}"; "\"}}";
$.getJSON( $.getJSON(
"/api/" + $("#search-plugin").val() + "/search", "/api/" + $("#search-plugin").val() + "/search",