From cd9fec95b73aacbdb2c970c6c621a0bbbf7c1b49 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 12 Dec 2018 11:31:47 -0700 Subject: [PATCH] Fixing single quote searching issue. Fixes #27 --- server/service/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/service/src/main.rs b/server/service/src/main.rs index 2689706..78635d7 100644 --- a/server/service/src/main.rs +++ b/server/service/src/main.rs @@ -81,7 +81,7 @@ struct Torrent { fn sql_search(query: &str, size: usize, offset: usize) -> Vec { let stmt_str = format!( "select * from torrents where name like '%{}%' limit {} offset {}", - query.replace(" ", "%"), + query.replace(" ", "%").replace("\'","''"), size, offset );