]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixing /related_questions/ errors.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 10:43:29 +0000 (10:43 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 25 May 2010 10:43:29 +0000 (10:43 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@325 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/pgfulltext/handlers.py

index ff29f14823f7b8ac2db06aa7dba4bdda84c135c9..fc64bac73216841f37e3e9cf6940bbb918db7f85 100644 (file)
@@ -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],