Fixed queries to get rid of the sphinx error "syntax error, unexpected $end near '' by escaping each search query (unless if the search query is using the `Extended Syntax`. All related dicussions should have their thread title retrieved from database escaped using the built-in sphinx API. Sphinx uses the installed charset to determine what to escape.