MDL-61839 glossary: One letter search in glossary returns all entries
authorMihail Geshoski <mihail@moodle.com>
Fri, 1 Jun 2018 00:43:56 +0000 (08:43 +0800)
committerMihail Geshoski <mihail@moodle.com>
Mon, 6 Aug 2018 01:45:34 +0000 (09:45 +0800)
mod/glossary/lib.php

index 98756d7..84055d4 100644 (file)
@@ -3820,10 +3820,10 @@ function glossary_get_entries_by_search($glossary, $context, $query, $fullsearch
                                         $options = array()) {
     global $DB, $USER;
 
-    // Remove too little terms.
+    // Clean terms.
     $terms = explode(' ', $query);
     foreach ($terms as $key => $term) {
-        if (strlen(trim($term, '+-')) < 2) {
+        if (strlen(trim($term, '+-')) < 1) {
             unset($terms[$key]);
         }
     }