diff --git a/mod/lesson/action/addpage.php b/mod/lesson/action/addpage.php index 58c6ee22bb6..3bcc833ce94 100644 --- a/mod/lesson/action/addpage.php +++ b/mod/lesson/action/addpage.php @@ -32,7 +32,7 @@ while (true) { if ($apageid) { $title = get_field("lesson_pages", "title", "id", $apageid); - $jump[$apageid] = $title; + $jump[$apageid] = strip_tags(format_string($title,true)); $apageid = get_field("lesson_pages", "nextpageid", "id", $apageid); } else { // last page reached @@ -238,4 +238,4 @@ "> "> - \ No newline at end of file + diff --git a/mod/lesson/action/confirmdelete.php b/mod/lesson/action/confirmdelete.php index c668e0b1651..4e7625f3400 100644 --- a/mod/lesson/action/confirmdelete.php +++ b/mod/lesson/action/confirmdelete.php @@ -12,7 +12,7 @@ if (!$thispage = get_record("lesson_pages", "id", $pageid)) { error("Confirm delete: the page record not found"); } - print_heading(get_string("deletingpage", "lesson", $thispage->title)); + print_heading(get_string("deletingpage", "lesson", format_string($thispage->title))); // print the jumps to this page if ($answers = get_records_select("lesson_answers", "lessonid = $lesson->id AND jumpto = $pageid + 1")) { print_heading(get_string("thefollowingpagesjumptothispage", "lesson")); diff --git a/mod/lesson/action/editpage.php b/mod/lesson/action/editpage.php index 74b420b4253..93284fa8a85 100644 --- a/mod/lesson/action/editpage.php +++ b/mod/lesson/action/editpage.php @@ -44,7 +44,7 @@ } /// CDC-FLAG /// 6/15/04 removed != LESSON_ENDOFBRANCH... if (trim($page->title)) { // ...nor nuffin pages - $jump[$apageid] = $apage->title; + $jump[$apageid] = strip_tags(format_string($apage->title,true)); } $apageid = $apage->nextpageid; } else { diff --git a/mod/lesson/action/insertpage.php b/mod/lesson/action/insertpage.php index d4505b34f60..c400b29f404 100644 --- a/mod/lesson/action/insertpage.php +++ b/mod/lesson/action/insertpage.php @@ -40,7 +40,7 @@ $newpage->display = 0; } /// CDC-FLAG /// - $newpage->title = clean_param($form->title, PARAM_CLEAN); + $newpage->title = clean_param($form->title, PARAM_CLEANHTML); $newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML); $newpageid = insert_record("lesson_pages", $newpage); if (!$newpageid) { @@ -83,7 +83,7 @@ $newpage->display = 0; } /// CDC-FLAG /// - $newpage->title = clean_param($form->title, PARAM_CLEAN); + $newpage->title = clean_param($form->title, PARAM_CLEANHTML); $newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML); $newpageid = insert_record("lesson_pages", $newpage); if (!$newpageid) { @@ -113,7 +113,7 @@ $newpage->display = 0; } /// CDC-FLAG /// - $newpage->title = clean_param($form->title, PARAM_CLEAN); + $newpage->title = clean_param($form->title, PARAM_CLEANHTML); $newpage->contents = clean_param(trim($form->contents), PARAM_CLEANHTML); $newpageid = insert_record("lesson_pages", $newpage); if (!$newpageid) { @@ -188,4 +188,4 @@ } /// CDC-FLAG /// redirect("view.php?id=$cm->id", get_string('insertedpage', 'lesson')); -?> \ No newline at end of file +?> diff --git a/mod/lesson/action/move.php b/mod/lesson/action/move.php index 1c4f4a818b0..270ac8cb9e7 100644 --- a/mod/lesson/action/move.php +++ b/mod/lesson/action/move.php @@ -8,7 +8,7 @@ $pageid = required_param('pageid', PARAM_INT); $title = get_field("lesson_pages", "title", "id", $pageid); - print_heading(get_string("moving", "lesson", $title)); + print_heading(get_string("moving", "lesson", format_string($title))); if (!$page = get_record_select("lesson_pages", "lessonid = $lesson->id AND prevpageid = 0")) { error("Move: first page not found"); @@ -19,7 +19,7 @@ get_string("movepagehere", "lesson")."\n"; while (true) { if ($page->id != $pageid) { - if (!$title = trim($page->title)) { + if (!$title = trim(format_string($page->title))) { $title = "<< ".get_string("notitle", "lesson")." >>"; } echo "$title\n"; @@ -36,4 +36,4 @@ } } echo "\n"; -?> \ No newline at end of file +?> diff --git a/mod/lesson/action/moveit.php b/mod/lesson/action/moveit.php index 0b3e11f64b8..7b0a67d8371 100644 --- a/mod/lesson/action/moveit.php +++ b/mod/lesson/action/moveit.php @@ -14,7 +14,7 @@ } $after = required_param('after', PARAM_INT); // target page - print_heading(get_string("moving", "lesson", $page->title)); + print_heading(get_string("moving", "lesson", format_string($page->title))); // first step. determine the new first page // (this is done first as the current first page will be lost in the next step) @@ -99,4 +99,4 @@ error("Moveit: unable to update link"); } redirect("view.php?id=$cm->id", get_string('movedpage', 'lesson')); -?> \ No newline at end of file +?> diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 3cb74e3ada4..2a861133a58 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -927,7 +927,7 @@ function lesson_print_tree_link_menu($page, $id, $showpages=false) { } } - $output .= "id\">".$page->title."\n"; + $output .= "id\">".format_string($page->title,true)."\n"; if($close) { $output.=""; @@ -951,9 +951,9 @@ function lesson_print_tree($pageid, $lessonid, $cmid, $pixpath) { while ($pageid != 0) { echo ""; if(($pages[$pageid]->qtype != LESSON_BRANCHTABLE) && ($pages[$pageid]->qtype != LESSON_ENDOFBRANCH)) { - $output = "id."\">".$pages[$pageid]->title."\n"; + $output = "id."\">".format_string($pages[$pageid]->title,true)."\n"; } else { - $output = "id."\">".$pages[$pageid]->title."\n"; + $output = "id."\">".format_string($pages[$pageid]->title,true)."\n"; if($answers = get_records_select("lesson_answers", "lessonid = $lessonid and pageid = $pageid")) { $output .= "Jumps to: "; @@ -976,7 +976,7 @@ function lesson_print_tree($pageid, $lessonid, $cmid, $pixpath) { } elseif ($answer->jumpto == LESSON_CLUSTERJUMP) { $output .= get_string("clusterjump", "lesson"); } else { - $output .= $pages[$answer->jumpto]->title; + $output .= format_string($pages[$answer->jumpto]->title); } if ($answer->id != $end->id) { $output .= ", "; diff --git a/mod/lesson/report.php b/mod/lesson/report.php index 280ece11a90..802069c124e 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -406,7 +406,7 @@ $data =''; $answerdata = new stdClass; - $answerpage->title = $page->title; + $answerpage->title = format_string($page->title); $answerpage->contents = $page->contents; // get the page qtype @@ -741,7 +741,7 @@ } elseif ($answer->jumpto == LESSON_CLUSTERJUMP) { $data .= get_string("clusterjump", "lesson"); } else { - $data .= $lessonpages[$answer->jumpto]->title." ".get_string("page", "lesson"); + $data .= format_string($lessonpages[$answer->jumpto]->title)." ".get_string("page", "lesson"); } $answerdata->answers[] = array($data, ""); @@ -768,7 +768,7 @@ } elseif ($answer->jumpto == LESSON_CLUSTERJUMP) { $data .= get_string("clusterjump", "lesson"); } else { - $data .= $lessonpages[$answer->jumpto]->title." ".get_string("page", "lesson"); + $data .= format_string($lessonpages[$answer->jumpto]->title)." ".get_string("page", "lesson"); } $answerdata->answers[] = array($data, ""); $answerpage->grayout = 1; // always grayed out @@ -843,7 +843,7 @@ $fontend2 = ""; } - $table->head = array($fontstart2.$page->qtype.": ".$page->title.$fontend2, $fontstart2.get_string("classstats", "lesson").$fontend2); + $table->head = array($fontstart2.$page->qtype.": ".format_string($page->title).$fontend2, $fontstart2.get_string("classstats", "lesson").$fontend2); $table->data[] = array($fontstart.get_string("question", "lesson").":
".$fontend.$fontstart2.$page->contents.$fontend2, " "); $table->data[] = array($fontstart.get_string("answer", "lesson").":".$fontend); // apply the font to each answer diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 925394945b2..5060689acd1 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -549,7 +549,7 @@ echo format_string($lesson->name) . ""; if ($page->qtype == LESSON_BRANCHTABLE) { echo ":
"; - print_heading($page->title); + print_heading(format_string($page->title)); } echo "
"; @@ -1255,7 +1255,7 @@ /// CDC-FLAG /// end tree code (note, there is an "}" below for an else above) while (true) { echo "\n"; - echo "
$page->title  \n"; + echo "
".format_string($page->title)."  \n"; if (isteacheredit($course->id)) { if ($npages > 1) { echo "id&action=move&pageid=$page->id\">\n". @@ -1592,7 +1592,7 @@ $style = "style='color:#999999;'"; } // link for each essay - $essaylinks[] = "id&action=essaygrade&attemptid=$essay->id\">".$pages[$essay->pageid]->title.""; + $essaylinks[] = "id&action=essaygrade&attemptid=$essay->id\">".format_string($pages[$essay->pageid]->title,true).""; } } // email link for this user @@ -1774,7 +1774,7 @@ foreach ($essayattempts as $essay) { $essayinfo = unserialize($essay->useranswer); if ($essayinfo->graded && !$essayinfo->sent) { - $subject = get_string('essayemailsubject', 'lesson', $pages[$essay->pageid]->title); + $subject = get_string('essayemailsubject', 'lesson', format_string($pages[$essay->pageid]->title,true)); $message = get_string('question', 'lesson').":
"; $message .= $pages[$essay->pageid]->contents; $message .= "

";