Permalink
Browse files

MDL-36808 Completion: Incorrect escaping for activity name in complet…

…ion tickbox
  • Loading branch information...
1 parent fac9ba9 commit 0324045e4f8a5f05d550ec6b7c4f07fbe9340af7 @sammarshallou sammarshallou committed with danpoltawski Nov 27, 2012
Showing with 19 additions and 8 deletions.
  1. +19 −8 course/lib.php
View
@@ -1656,14 +1656,25 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
} else {
$extraclass = '';
}
- echo "
-<form class='togglecompletion$extraclass' method='post' action='".$CFG->wwwroot."/course/togglecompletion.php'><div>
-<input type='hidden' name='id' value='{$mod->id}' />
-<input type='hidden' name='modulename' value='".s($mod->name)."' />
-<input type='hidden' name='sesskey' value='".sesskey()."' />
-<input type='hidden' name='completionstate' value='$newstate' />
-<input type='image' src='$imgsrc' alt='$imgalt' title='$imgtitle' />
-</div></form>";
+ echo html_writer::start_tag('form', array(
+ 'class' => 'togglecompletion' . $extraclass,
+ 'method' => 'post',
+ 'action' => $CFG->wwwroot . '/course/togglecompletion.php'));
+ echo html_writer::start_tag('div');
+ echo html_writer::empty_tag('input', array(
+ 'type' => 'hidden', 'name' => 'id', 'value' => $mod->id));
+ echo html_writer::empty_tag('input', array(
+ 'type' => 'hidden', 'name' => 'modulename',
+ 'value' => $mod->name));
+ echo html_writer::empty_tag('input', array(
+ 'type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
+ echo html_writer::empty_tag('input', array(
+ 'type' => 'hidden', 'name' => 'completionstate',
+ 'value' => $newstate));
+ echo html_writer::empty_tag('input', array(
+ 'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle));
+ echo html_writer::end_tag('div');
+ echo html_writer::end_tag('form');
} else {
// In auto mode, or when editing, the icon is just an image
echo "<span class='autocompletion'>";

0 comments on commit 0324045

Please sign in to comment.