Skip to content

Commit

Permalink
MDL-13025 added data intro text formatting without cleaning - manage …
Browse files Browse the repository at this point in the history
…activity cap already marked with XSS risk; merged from MOODLE_19_STABLE
  • Loading branch information
skodak committed Apr 21, 2008
1 parent 2fd8093 commit ea6073b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions mod/data/index.php
Expand Up @@ -28,7 +28,7 @@
$id = required_param('id', PARAM_INT); // course

if (! $course = get_record("course", "id", $id)) {
print_error("Course ID is incorrect");
error("Course ID is incorrect");
}

require_course_login($course);
Expand Down Expand Up @@ -80,6 +80,9 @@
array_push($table->align, 'center');
}

$options = new object();
$options->noclean = true;

$currentsection = "";

foreach ($datas as $data) {
Expand Down Expand Up @@ -123,10 +126,10 @@
}
$currentsection = $data->section;
}
$row = array ($printsection, $link, $data->intro, $numrecords, $numunapprovedrecords);
$row = array ($printsection, $link, format_text($data->intro, FORMAT_MOODLE, $options), $numrecords, $numunapprovedrecords);

} else {
$row = array ($link, $data->intro, $numrecords, $numunapprovedrecords);
$row = array ($link, format_text($data->intro, FORMAT_MOODLE, $options), $numrecords, $numunapprovedrecords);
}

if ($rss) {
Expand Down
4 changes: 3 additions & 1 deletion mod/data/view.php
Expand Up @@ -307,7 +307,9 @@
}

if ($data->intro and empty($page) and empty($record) and $mode != 'single') {
print_box(format_text($data->intro), 'generalbox', 'intro');
$options = new object();
$options->noclean = true;
print_box(format_text($data->intro, FORMAT_MOODLE, $options), 'generalbox', 'intro');
}

/// Delete any requested records
Expand Down

0 comments on commit ea6073b

Please sign in to comment.