diff --git a/mod/survey/download.php b/mod/survey/download.php index 74653a4bdba..5b16acbfa7f 100644 --- a/mod/survey/download.php +++ b/mod/survey/download.php @@ -125,7 +125,7 @@ require_once("$CFG->libdir/excel/Workbook.php"); header("Content-type: application/vnd.ms-excel"); - $downloadfilename = clean_filename("$course->shortname $survey->name"); + $downloadfilename = clean_filename("$course->shortname ".strip_tags(format_string($survey->name,true))); header("Content-Disposition: attachment; filename=$downloadfilename.xls"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); @@ -133,7 +133,7 @@ $workbook = new Workbook("-"); // Creating the first worksheet - $myxls =& $workbook->add_worksheet(substr($survey->name, 0, 31)); + $myxls =& $workbook->add_worksheet(substr(strip_tags(format_string($survey->name,true)), 0, 31)); $header = array("surveyid","surveyname","userid","firstname","lastname","email","idnumber","time", "notes"); $col=0; @@ -166,7 +166,7 @@ $notes = "No notes made"; } $myxls->write_string($row,$col++,$survey->id); - $myxls->write_string($row,$col++,$survey->name); + $myxls->write_string($row,$col++,strip_tags(format_text($survey->name,true))); $myxls->write_string($row,$col++,$user); $myxls->write_string($row,$col++,$u->firstname); $myxls->write_string($row,$col++,$u->lastname); @@ -197,7 +197,7 @@ header("Content-Type: application/download\n"); - $downloadfilename = clean_filename("$course->shortname $survey->name"); + $downloadfilename = clean_filename("$course->shortname ".strip_tags(format_string($survey->name,true))); header("Content-Disposition: attachment; filename=\"$downloadfilename.txt\""); // Print names of all the fields @@ -221,7 +221,7 @@ error("Error finding student # $user"); } echo $survey->id."\t"; - echo $survey->name."\t"; + echo strip_tags(format_string($survey->name,true))."\t"; echo $user."\t"; echo $u->firstname."\t"; echo $u->lastname."\t"; diff --git a/mod/survey/graph.php b/mod/survey/graph.php index fdaaeb6ed0f..73058a446a1 100644 --- a/mod/survey/graph.php +++ b/mod/survey/graph.php @@ -341,7 +341,7 @@ $graph = new graph($SURVEY_GWIDTH,$SURVEY_GHEIGHT); - $graph->parameter['title'] = "$survey->name"; + $graph->parameter['title'] = strip_tags(format_string($survey->name,true)); $graph->x_data = $names; @@ -502,7 +502,7 @@ $graph = new graph($SURVEY_GWIDTH,$SURVEY_GHEIGHT); - $graph->parameter['title'] = "$survey->name"; + $graph->parameter['title'] = strip_tags(format_string($survey->name,true)); $graph->x_data = $names; diff --git a/mod/survey/index.php b/mod/survey/index.php index 31f1163cd91..be0a896ccf2 100644 --- a/mod/survey/index.php +++ b/mod/survey/index.php @@ -60,10 +60,10 @@ //Calculate the href if (!$survey->visible) { //Show dimmed if the mod is hidden - $tt_href = "coursemodule\">$survey->name"; + $tt_href = "coursemodule\">".format_string($survey->name,true).""; } else { //Show normal if the mod is visible - $tt_href = "coursemodule\">$survey->name"; + $tt_href = "coursemodule\">".format_string($survey->name,true)"."; } if ($course->format == "weeks" or $course->format == "topics") { diff --git a/mod/survey/report.php b/mod/survey/report.php index 48494acc439..73c72201028 100644 --- a/mod/survey/report.php +++ b/mod/survey/report.php @@ -53,13 +53,13 @@ if ($course->category) { $navigation = "id\">$course->shortname -> id\">$strsurveys -> - id\">$survey->name -> "; + id\">".format_string($survey->name,true)." -> "; } else { $navigation = "id\">$strsurveys -> - id\">$survey->name -> "; + id\">".format_string($survey->name,true)." -> "; } - print_header("$course->shortname: $survey->name", "$course->fullname", "$navigation $strreport", + print_header("$course->shortname: ".format_string($survey->name), "$course->fullname", "$navigation $strreport", "", "", true, update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm)); diff --git a/mod/survey/restorelib.php b/mod/survey/restorelib.php index 8e343bac40b..4df2006ec8e 100644 --- a/mod/survey/restorelib.php +++ b/mod/survey/restorelib.php @@ -53,7 +53,7 @@ $newid = insert_record ("survey",$survey); //Do some output - echo "
  • ".get_string("modulename","survey")." \"".$survey->name."\"
  • "; + echo "
  • ".get_string("modulename","survey")." \"".format_string(stripslashes($survey->name),true)."\"
  • "; backup_flush(300); if ($newid) { diff --git a/mod/survey/save.php b/mod/survey/save.php index f7063874ad9..385573f299e 100644 --- a/mod/survey/save.php +++ b/mod/survey/save.php @@ -90,7 +90,7 @@ $strsurveysaved = get_string("surveysaved", "survey"); print_header_simple("$strsurveysaved", "", - "id\">$strsurveys -> $survey->name -> $strsurveysaved", ""); + "id\">$strsurveys -> ".format_string($survey->name)." -> $strsurveysaved", ""); notice(get_string("thanksforanswers","survey", $USER->firstname), "$CFG->wwwroot/course/view.php?id=$course->id"); diff --git a/mod/survey/view.php b/mod/survey/view.php index 35f0da5c807..0c11b5ebab7 100644 --- a/mod/survey/view.php +++ b/mod/survey/view.php @@ -28,8 +28,8 @@ $strsurveys = get_string("modulenameplural", "survey"); $strsurvey = get_string("modulename", "survey"); - print_header_simple("$survey->name", "", - "id\">$strsurveys -> $survey->name", "", "", true, + print_header_simple(format_string($survey->name), "", + "id\">$strsurveys -> ".format_string($survey->name), "", "", true, update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm)); /// Check to see if groups are being used in this survey