From f8a5159a2b8e99311469b4b107370443a3e080ab Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 14 Apr 2006 08:02:32 +0000 Subject: [PATCH] changes needed for new s() and p() - see bug #2338 --- course/edit.php | 4 ++++ course/editsection.html | 2 +- course/editsection.php | 4 +++- course/group-edit.html | 2 +- course/group.php | 2 -- course/importstudents.html | 2 +- course/lib.php | 6 +++--- course/request.php | 4 ++++ course/search.php | 2 +- course/student.html | 2 +- course/teacher.php | 2 +- lib/weblib.php | 4 ++-- 12 files changed, 22 insertions(+), 14 deletions(-) diff --git a/course/edit.php b/course/edit.php index 9c22c070a2..0e2bd224c6 100644 --- a/course/edit.php +++ b/course/edit.php @@ -208,8 +208,12 @@ $form->students = get_string("defaultcoursestudents"); } } + } else { + $form = stripslashes_safe($form); } + // !! no db access using data from $form beyond this point !! + $form->categories = get_records_select_menu("course_categories", "", "name", "id,name"); $courseformats = get_list_of_plugins("course/format"); diff --git a/course/editsection.html b/course/editsection.html index ecc813b778..913d0b07af 100644 --- a/course/editsection.html +++ b/course/editsection.html @@ -22,7 +22,7 @@ - + " /> diff --git a/course/editsection.php b/course/editsection.php index 4afb042945..2e7437b063 100644 --- a/course/editsection.php +++ b/course/editsection.php @@ -41,9 +41,11 @@ if (empty($form)) { $form = $section; + } else { + $form = stripslashes_safe($form); } - $form->sesskey = !empty($USER->id) ? $USER->sesskey : ''; + // !! no db access using data from $form beyond this point !! $usehtmleditor = can_use_html_editor(); diff --git a/course/group-edit.html b/course/group-edit.html index 57969bbea0..8802ffd3b9 100644 --- a/course/group-edit.html +++ b/course/group-edit.html @@ -57,5 +57,5 @@ - + diff --git a/course/group.php b/course/group.php index 2c043b207b..0d38ca0ae1 100644 --- a/course/group.php +++ b/course/group.php @@ -75,8 +75,6 @@ $usehtmleditor = false; - $sesskey = !empty($USER->id) ? $USER->sesskey : ''; - include('group-edit.html'); echo ""; diff --git a/course/importstudents.html b/course/importstudents.html index dc9a87b75c..ed9b879dd6 100644 --- a/course/importstudents.html +++ b/course/importstudents.html @@ -60,7 +60,7 @@ ?>
- wwwroot.'/course/search.php" method="get">'; $output .= '

'; - $output .= ''; + $output .= ''; $output .= ''; $output .= '

'; } else if ($format == 'short') { $output = '
'; $output .= '

'; - $output .= ''; + $output .= ''; $output .= ''; $output .= '

'; } else if ($format == 'navbar') { $output = '
'; $output .= '
'; - $output .= ''; + $output .= ''; $output .= ''; $output .= '
'; $output .= '
'; diff --git a/course/request.php b/course/request.php index 099766403e..d46b100c25 100644 --- a/course/request.php +++ b/course/request.php @@ -32,7 +32,11 @@ } print_footer(); exit; + } else { + $form = stripslashes_safe($form); } + + // !! no db access using data from $form beyond this point !! } // print_simple_box(get_string('courserequestintro'),'center'); diff --git a/course/search.php b/course/search.php index 9a10f5d76f..2ae91a49e3 100644 --- a/course/search.php +++ b/course/search.php @@ -130,7 +130,7 @@ print_header("$site->fullname : $strsearchresults", $site->fullname, - "$strcourses -> $strsearch -> '".s($search)."'", "", "", "", $searchform); + "$strcourses -> $strsearch -> '".s($search, true)."'", "", "", "", $searchform); $lastcategory = -1; diff --git a/course/student.html b/course/student.html index b9e23c8707..a7fdf549b5 100644 --- a/course/student.html +++ b/course/student.html @@ -74,7 +74,7 @@ ?>
- ($strsearchresults : ".s($search).")

"; + echo "

($strsearchresults : ".s($search, true).")

"; } if (!$users = get_users(true, $search, true, $teacherlist)) { diff --git a/lib/weblib.php b/lib/weblib.php index 0f4b3d16d1..f71ddd4efc 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3538,10 +3538,10 @@ function update_categories_search_button($search,$page,$perpage) { return "
framename\" method=\"get\" action=\"$CFG->wwwroot/course/search.php\">". "". "sesskey\" />". - "". + "". "". "". - "
"; + ""; } } -- 2.39.5