prevent crashes on filter regexp being too advanced for our database when testing filters (refs #508)

master
Andrew Dolgov 12 years ago
parent 6e577ba157
commit dd8c36af4b

@ -2321,7 +2321,20 @@
$override_order = "updated DESC"; $override_order = "updated DESC";
$filter_query_part = filter_to_sql($filter) . " AND"; $filter_query_part = filter_to_sql($filter);
// Try to check if SQL regexp implementation chokes on a valid regexp
$result = db_query($link, "SELECT true FROM ttrss_entries
WHERE $filter_query_part LIMIT 1", false);
$test = db_fetch_result($result, 0, "true");
if (!$test) {
$filter_query_part = "false AND";
} else {
$filter_query_part .= " AND";
}
} else { } else {
$filter_query_part = ""; $filter_query_part = "";
} }

Loading…
Cancel
Save