diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -717,6 +717,13 @@ function get_courses_search($searchterms, $sort='fullname ASC', $page=0, $record
     $summarysearch = '';
 
     foreach ($searchterms as $searchterm) {
+
+    /// Under Oracle and MSSQL, trim the + and - operators and perform
+    /// simpler LIKE search
+        if ($CFG->dbtype == 'oci8po' || $CFG->dbtype == 'mssql' || $CFG->dbtype == 'mssql_n' || $CFG->dbtype == 'odbc_mssql') {
+            $searchterm = trim($searchterm, '+-');
+        }
+
         if ($fullnamesearch) {
             $fullnamesearch .= ' AND ';
         }
Prevent +/- operators (REGEXP) on course searches for MSSQL and Oracle. MDL-<I>

Merged from MOODLE_<I>_STABLE