mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 18:15:56 +00:00
prevent a fatal error on an invalid tsquery syntax
This commit is contained in:
@@ -1434,6 +1434,17 @@ class Feeds extends Handler_Protected {
|
|||||||
if (!$search_query_part) {
|
if (!$search_query_part) {
|
||||||
list($search_query_part, $search_words) = search_to_sql($search, $search_language);
|
list($search_query_part, $search_words) = search_to_sql($search, $search_language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DB_TYPE == "pgsql") {
|
||||||
|
$test_sth = $pdo->prepare("select $search_query_part from ttrss_entries limit 1");
|
||||||
|
try {
|
||||||
|
$test_sth->execute();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
// looks like tsquery syntax is invalid
|
||||||
|
$search_query_part = "false";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$search_query_part .= " AND ";
|
$search_query_part .= " AND ";
|
||||||
} else {
|
} else {
|
||||||
$search_query_part = "";
|
$search_query_part = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user