diff --git a/blocks/admin/block_admin.php b/blocks/admin/block_admin.php
index ebc31816ebe..b0b7c5f616d 100644
--- a/blocks/admin/block_admin.php
+++ b/blocks/admin/block_admin.php
@@ -164,10 +164,10 @@ class block_admin extends block_list {
if (empty($course->metacourse) && ($course->id!==SITEID)) {
if (has_capability('moodle/legacy:guest', $context, NULL, false)) { // Are a guest now
- $this->content->items[]=''.get_string('enrolme', '', $course->shortname).'';
+ $this->content->items[]=''.get_string('enrolme', '', s($course->shortname)).'';
$this->content->icons[]='
';
} else if (has_capability('moodle/role:unassignself', $context, NULL, false)) { // Have some role
- $this->content->items[]=''.get_string('unenrolme', '', $course->shortname).'';
+ $this->content->items[]=''.get_string('unenrolme', '', s($course->shortname)).'';
$this->content->icons[]='
';
}
}
diff --git a/blocks/course_list/block_course_list.php b/blocks/course_list/block_course_list.php
index 3e9a2ba5db1..b68b5b6407e 100644
--- a/blocks/course_list/block_course_list.php
+++ b/blocks/course_list/block_course_list.php
@@ -44,8 +44,8 @@ class block_course_list extends block_list {
continue;
}
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
- $this->content->items[]="shortname\" ".
- "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname";
+ $this->content->items[]="shortname) . "\" ".
+ "href=\"$CFG->wwwroot/course/view.php?id=$course->id\">" . s($course->fullname) . "";
$this->content->icons[]=$icon;
}
$this->title = get_string('mycourses');
@@ -62,7 +62,7 @@ class block_course_list extends block_list {
if (count($categories) > 1 || (count($categories) == 1 && count_records('course') > 200)) { // Just print top level category links
foreach ($categories as $category) {
$linkcss = $category->visible ? "" : " class=\"dimmed\" ";
- $this->content->items[]="wwwroot/course/category.php?id=$category->id\">$category->name";
+ $this->content->items[]="wwwroot/course/category.php?id=$category->id\">" . s($category->name) . "";
$this->content->icons[]=$icon;
}
$this->content->icons[] = '';
@@ -77,7 +77,7 @@ class block_course_list extends block_list {
if ($courses) {
foreach ($courses as $course) {
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
- $this->content->items[]="shortname\" ".
+ $this->content->items[]="shortname)."\" ".
"href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->fullname";
$this->content->icons[]=$icon;
}
diff --git a/course/index.php b/course/index.php
index 8e63f08ef16..b45ba8a409d 100644
--- a/course/index.php
+++ b/course/index.php
@@ -106,9 +106,9 @@
$newcategory->name = $form->addcategory;
$newcategory->sortorder = 999;
if (!insert_record('course_categories', $newcategory)) {
- notify("Could not insert the new category '$newcategory->name'");
+ notify("Could not insert the new category '" . s($newcategory->name) . "'");
} else {
- notify(get_string('categoryadded', '', $newcategory->name));
+ notify(get_string('categoryadded', '', s($newcategory->name)));
}
}
}
@@ -145,11 +145,11 @@
/// Finally delete the category itself
if (delete_records('course_categories', 'id', $deletecat->id)) {
- notify(get_string('categorydeleted', '', $deletecat->name));
+ notify(get_string('categorydeleted', '', s($deletecat->name)));
}
}
else {
- $strdeletecategorycheck = get_string('deletecategorycheck','',$deletecat->name);
+ $strdeletecategorycheck = get_string('deletecategorycheck','', s($deletecat->name));
notice_yesno($strdeletecategorycheck,
"index.php?delete=$delete&sure=".md5($deletecat->timemodified)."&sesskey=$USER->sesskey",
"index.php?sesskey=$USER->sesskey");
@@ -353,7 +353,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
$linkcss = $category->visible ? '' : ' class="dimmed" ';
echo ''.
- $category->name.'';
+ s($category->name).'';
echo '';
echo '