diff options
author | 2018-06-01 11:48:23 +0300 | |
---|---|---|
committer | 2018-06-01 11:48:23 +0300 | |
commit | c549a5493b40aa639f9af898e1490344c0aa2b3b (patch) | |
tree | bff658e9ba703ddfb26a1d06ceac87c82e7c8157 /juick-www/src/test | |
parent | 84b2f994bd9b6b46155dda5953922cc0882c6514 (diff) |
server: handmade SphinxSE query mapping
Diffstat (limited to 'juick-www/src/test')
-rw-r--r-- | juick-www/src/test/java/com/juick/WebAppTests.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/juick-www/src/test/java/com/juick/WebAppTests.java b/juick-www/src/test/java/com/juick/WebAppTests.java index e74b694e..74be2c92 100644 --- a/juick-www/src/test/java/com/juick/WebAppTests.java +++ b/juick-www/src/test/java/com/juick/WebAppTests.java @@ -25,6 +25,7 @@ import com.gargoylesoftware.htmlunit.html.DomElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.juick.service.*; import com.juick.util.MessageUtils; +import com.juick.www.Utils; import com.juick.www.WebApp; import com.mitchellbosecke.pebble.PebbleEngine; import com.mitchellbosecke.pebble.error.PebbleException; @@ -414,4 +415,9 @@ public class WebAppTests { HtmlPage unreadThread = webClient.getPage(String.format("http://localhost:8080/ugnich/%d", mid)); assertThat(unreadThread.querySelectorAll("#global a .badge").size(), is(0)); } + @Test + public void escapeSqlTests() { + String sql = String.format("SELECT * FROM table WHERE data='%s'", Utils.encodeSphinx("';-- DROP TABLE table")); + assertThat(sql, is("SELECT * FROM table WHERE data='\\';-- DROP TABLE table\'")); + } } |