From 6bb4875f35b52031902077ae1aad9e7cdd49ca69 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 31 Oct 2006 20:22:10 +0000 Subject: [PATCH] Prevent +/- operators (REGEXP) on messages search. MDL-7312 Merged from MOODLE_17_STABLE --- message/lib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/message/lib.php b/message/lib.php index 52edb75e4c..72a9aa612f 100644 --- a/message/lib.php +++ b/message/lib.php @@ -739,6 +739,12 @@ function message_search($searchterms, $fromme=true, $tome=true, $courseid='none' if (strlen($searchterm) < 2) { continue; } + /// 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 ($messagesearch) { $messagesearch .= " AND "; } -- 2.39.5