Skip to content
Browse files

MDL-30545 - messagelib: use $DB->sql_concat()

  • Loading branch information...
1 parent 1f5205b commit 675ea3231cf1593bb07168cbeb8085b43966df1b @danpoltawski danpoltawski committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/messagelib.php
View
5 lib/messagelib.php
@@ -447,7 +447,8 @@ function message_get_providers_for_user($userid) {
WHERE ra.userid = :userid
AND rc.capability $capcondition
AND rc.permission > 0
- AND (CONCAT(actx.path, '/') LIKE CONCAT(cctx.path, '/%') OR CONCAT(cctx.path, '/') LIKE CONCAT(actx.path, '/%'))";
+ AND (".$DB->sql_concat('actx.path', "'/'")." LIKE ".$DB->sql_concat('cctx.path', "'/%'").
+ " OR ".$DB->sql_concat('cctx.path', "'/'")." LIKE ".$DB->sql_concat('actx.path', "'/%'").")";
if (!empty($CFG->defaultfrontpageroleid)) {
$frontpagecontext = context_course::instance(SITEID);
@@ -469,7 +470,7 @@ function message_get_providers_for_user($userid) {
WHERE rc.roleid = :frontpageroleid
AND rc.capability $capcondition2
AND rc.permission > 0
- AND CONCAT(cctx.path, '/') LIKE :frontpagepathpattern";
+ AND ".$DB->sql_concat('cctx.path', "'/'")." LIKE :frontpagepathpattern";
}
$relevantcapabilities = $DB->get_records_sql_menu($sql, $params);

0 comments on commit 675ea32

Please sign in to comment.
Something went wrong with that request. Please try again.