diff options
Diffstat (limited to 'include/functions.php')
| -rw-r--r--[-rwxr-xr-x] | include/functions.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/functions.php b/include/functions.php index 3adeae924..6dc9990e8 100755..100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@ <?php define('EXPECTED_CONFIG_VERSION', 26); - define('SCHEMA_VERSION', 137); + define('SCHEMA_VERSION', 138); define('LABEL_BASE_INDEX', -1024); define('PLUGIN_FEED_BASE_INDEX', -128); @@ -1203,6 +1203,7 @@ "goto_fresh" => __("Fresh"), "goto_marked" => __("Starred"), "goto_published" => __("Published"), + "goto_read" => __("Recently read"), "goto_tagcloud" => __("Tag cloud"), "goto_prefs" => __("Preferences")), __("Other") => array( @@ -1269,6 +1270,7 @@ "g f" => "goto_fresh", "g s" => "goto_marked", "g p" => "goto_published", + "g r" => "goto_read", "g t" => "goto_tagcloud", "g P" => "goto_prefs", "r" => "select_article_cursor", @@ -1484,11 +1486,19 @@ } if (count($search_query_leftover) > 0) { - $search_query_leftover = $pdo->quote(implode(" & ", $search_query_leftover)); if (DB_TYPE == "pgsql") { + + // if there's no joiners consider this a "simple" search and + // concatenate everything with &, otherwise don't try to mess with tsquery syntax + if (preg_match("/[&|]/", implode(" " , $search_query_leftover))) { + $tsquery = $pdo->quote(implode(" ", $search_query_leftover)); + } else { + $tsquery = $pdo->quote(implode(" & ", $search_query_leftover)); + } + array_push($query_keywords, - "(tsvector_combined @@ to_tsquery($search_language, $search_query_leftover))"); + "(tsvector_combined @@ to_tsquery($search_language, $tsquery))"); } } |