From: stronk7 Date: Tue, 31 Oct 2006 20:22:10 +0000 (+0000) Subject: Prevent +/- operators (REGEXP) on messages search. MDL-7312 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6bb4875f35b52031902077ae1aad9e7cdd49ca69;p=moodle.git Prevent +/- operators (REGEXP) on messages search. MDL-7312 Merged from MOODLE_17_STABLE --- 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 "; }