Merge branch '25STABLE-wip-MDL44021' of git://github.com/jennymgray/moodle into MOODLE_25_STABLE

This commit is contained in:
Marina Glancy
2014-04-01 17:41:31 +08:00
+11 -11
View File
@@ -152,15 +152,6 @@
//$params = array();
$i = 0;
if (empty($fullsearch)) {
// With fullsearch disabled, look only within concepts and aliases.
$concat = $DB->sql_concat('ge.concept', "' '", "COALESCE(al.alias, :emptychar)");
} else {
// With fullsearch enabled, look also within definitions.
$concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition', "' '", "COALESCE(al.alias, :emptychar)");
}
$params['emptychar'] = '';
$searchterms = explode(" ",$hook);
foreach ($searchterms as $searchterm) {
@@ -169,8 +160,17 @@
$NOT = false; /// Initially we aren't going to perform NOT LIKE searches, only MSSQL and Oracle
/// will use it to simulate the "-" operator with LIKE clause
/// Under Oracle and MSSQL, trim the + and - operators and perform
/// simpler LIKE (or NOT LIKE) queries
if (empty($fullsearch)) {
// With fullsearch disabled, look only within concepts and aliases.
$concat = $DB->sql_concat('ge.concept', "' '", "COALESCE(al.alias, :emptychar".$i.")");
} else {
// With fullsearch enabled, look also within definitions.
$concat = $DB->sql_concat('ge.concept', "' '", 'ge.definition', "' '", "COALESCE(al.alias, :emptychar".$i.")");
}
$params['emptychar'.$i] = '';
/// Under Oracle and MSSQL, trim the + and - operators and perform
/// simpler LIKE (or NOT LIKE) queries
if (!$DB->sql_regex_supported()) {
if (substr($searchterm, 0, 1) == '-') {
$NOT = true;