X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/0ba16baba0615dd405486c7d87f943d71518375c..160d1ba325585d57e013437f68b06bc90ac341d0:/forum_modules/pgfulltext/handlers.py diff --git a/forum_modules/pgfulltext/handlers.py b/forum_modules/pgfulltext/handlers.py index ff29f14..fc64bac 100644 --- a/forum_modules/pgfulltext/handlers.py +++ b/forum_modules/pgfulltext/handlers.py @@ -15,7 +15,7 @@ def question_search(self, keywords): }, where=[""" "forum_rootnode_doc"."node_id" = "forum_node"."id" AND ("forum_rootnode_doc"."document" @@ to_tsquery('english', %s) OR - "forum_node"."title" ILIKE '""" + keywords + """%%') + "forum_node"."title" ILIKE '""" + keywords.replace("'",r"\'") + """%%') """], params=[tsquery], select_params=[tsquery],