diff options
author | Andrew Dolgov <[email protected]> | 2013-04-09 16:30:45 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-09 16:30:45 +0400 |
commit | efd840d87fec6dfd54d381d4b44eb609d98c9d8e (patch) | |
tree | 102115bb8a2bd1689c6bf4208103d897c5ecf47c /include | |
parent | 1666e95522f4f789378ed5445e199d87d463bb86 (diff) |
search_to_sql: fix searching for reserved keywords
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index 68d2df344..f639b973b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2143,12 +2143,18 @@ if ($commandpair[1]) { array_push($query_keywords, "($not (LOWER(ttrss_entries.title) LIKE '%". db_escape_string($link, mb_strtolower($commandpair[1]))."%'))"); + } else { + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') + OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))"); } break; case "author": if ($commandpair[1]) { array_push($query_keywords, "($not (LOWER(author) LIKE '%". db_escape_string($link, mb_strtolower($commandpair[1]))."%'))"); + } else { + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') + OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))"); } break; case "note": @@ -2160,6 +2166,9 @@ else array_push($query_keywords, "($not (LOWER(note) LIKE '%". db_escape_string($link, mb_strtolower($commandpair[1]))."%'))"); + } else { + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') + OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))"); } break; case "star": @@ -2169,6 +2178,9 @@ array_push($query_keywords, "($not (marked = true))"); else array_push($query_keywords, "($not (marked = false))"); + } else { + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') + OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))"); } break; case "pub": @@ -2178,6 +2190,9 @@ else array_push($query_keywords, "($not (published = false))"); + } else { + array_push($query_keywords, "(UPPER(ttrss_entries.title) $not LIKE UPPER('%$k%') + OR UPPER(ttrss_entries.content) $not LIKE UPPER('%$k%'))"); } break; default: |