Fixing single quote searching issue. Fixes #27

This commit is contained in:
Dessalines 2018-12-12 11:31:47 -07:00
parent cc935387cb
commit cd9fec95b7
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ struct Torrent {
fn sql_search(query: &str, size: usize, offset: usize) -> Vec<Torrent> { fn sql_search(query: &str, size: usize, offset: usize) -> Vec<Torrent> {
let stmt_str = format!( let stmt_str = format!(
"select * from torrents where name like '%{}%' limit {} offset {}", "select * from torrents where name like '%{}%' limit {} offset {}",
query.replace(" ", "%"), query.replace(" ", "%").replace("\'","''"),
size, size,
offset offset
); );