]> git.mjollnir.org Git - moodle.git/commitdiff
strip_tags() to some parameters. Thanks skodak.
authorstronk7 <stronk7>
Sun, 29 Aug 2004 22:57:41 +0000 (22:57 +0000)
committerstronk7 <stronk7>
Sun, 29 Aug 2004 22:57:41 +0000 (22:57 +0000)
Bug 1836
(http://moodle.org/bugs/bug.php?op=show&bugid=1836)

Merged from MOODLE_14_STABLE

mod/glossary/approve.php
mod/glossary/comment.php
mod/glossary/deleteentry.php
mod/glossary/edit.php
mod/glossary/editcategories.php
mod/glossary/exportentry.php
mod/glossary/formats.php
mod/glossary/print.php
mod/glossary/view.php

index a1258690daa7796fdcfe06375d797ba6be3f2171..9bd46e5b49f5546b5009c6865ecf8f62367dc632 100644 (file)
@@ -9,6 +9,9 @@
     optional_variable($mode,"approval");
     optional_variable($hook,"ALL");
 
+    $mode = strip_tags(urldecode($mode));  //XSS 
+    $hook = strip_tags(urldecode($hook));  //XSS 
+
     if (! $cm = get_record("course_modules", "id", $id)) {
         error("Course Module ID was incorrect");
     } 
index 2d91df2e4bd3ce12e62b2b0aa2b734867826c872..ef80a3713d76de24da6bf988e6dcef72ff702bb0 100644 (file)
@@ -11,6 +11,8 @@
     optional_variable($action,"add");     // Action to perform
     optional_variable($confirm,0);     // Confirm the action
 
+    $action = strip_tags(urldecode($action));  //XSS
+
     $action = strtolower($action);
 
     global $THEME, $USER, $CFG;
index 15a860554e421b0b8f1ebf45c95a895cb7b6a3b2..5508a6b7fd453e658dafb037c244a20f95dab91b 100644 (file)
@@ -9,6 +9,9 @@
     require_variable($prevmode);  //  current frame
     optional_variable($hook);         // pivot id 
 
+    $prevmode = strip_tags(urldecode($prevmode));  //XSS
+    $hook = strip_tags(urldecode($hook));  //XSS
+
     $strglossary = get_string("modulename", "glossary");
     $strglossaries = get_string("modulenameplural", "glossary");
     $stredit = get_string("edit");
index a6b1e7824fe8979129044af020dc1bb66892156d..b58098fccfed12fe9e46442d1aec0428de526859 100644 (file)
@@ -12,6 +12,9 @@ optional_variable($confirm,0);    // proceed. Edit the edtry
 optional_variable($mode);   // categories if by category?
 optional_variable($hook);    // CategoryID
 
+$mode = strip_tags(urldecode($mode));  //XSS
+$hook = strip_tags(urldecode($hook));  //XSS
+
 if (! $cm = get_record("course_modules", "id", $id)) {
     error("Course Module ID was incorrect");
 }
index 03a0168c5e1b03afd797db304a3019a2d19c7fdf..3dd0c09403d4bc179f5ca2db842de307d37d0b85 100644 (file)
@@ -5,16 +5,20 @@
     require_once("../../config.php");
     require_once("lib.php");
 
-     require_variable($id);    // Course Module ID, or
-     optional_variable($mode);  // cat
-     optional_variable($hook);  // category ID
-     optional_variable($action);  // what to do
-     optional_variable($usedynalink);  // category ID
-     optional_variable($confirm);  // confirm the action
+    require_variable($id);    // Course Module ID, or
+    optional_variable($mode);  // cat
+    optional_variable($hook);  // category ID
+    optional_variable($action);  // what to do
+    optional_variable($usedynalink);  // category ID
+    optional_variable($confirm);  // confirm the action
 
-     optional_variable($name);  // confirm the action
+    optional_variable($name);  // confirm the action
 
-     $action = strtolower($action);
+    $action = strip_tags(urldecode($action));  //XSS
+    $hook = strip_tags(urldecode($hook));  //XSS
+    $mode = strip_tags(urldecode($mode));  //XSS
+
+    $action = strtolower($action);
         
     if (! $cm = get_record("course_modules", "id", $id)) {
         error("Course Module ID was incorrect");
index 93809a5b00ab52a18b6d077c62d94c0aadee0310..3def1c5b06f44895c7eb883d94fae7a9911c8112 100644 (file)
@@ -2,13 +2,16 @@
     require_once("../../config.php");
     require_once("lib.php");
 
-        require_variable($id);    // course module ID
-        require_variable($entry);    // Entry ID
-        optional_variable($confirm);     // confirmation
-        optional_variable($mode);
-        optional_variable($hook);
+    require_variable($id);    // course module ID
+    require_variable($entry);    // Entry ID
+    optional_variable($confirm);     // confirmation
+    optional_variable($mode);
+    optional_variable($hook);
+
+    $hook = strip_tags(urldecode($hook));  //XSS
+    $mode = strip_tags(urldecode($mode));  //XSS
         
-        global $THEME, $USER, $CFG;
+    global $THEME, $USER, $CFG;
 
     $PermissionGranted = 1;
 
index d7ae740f32818cb74d310f45d62b59e07ee9764c..fdd386707698ebab3a3c2b694f3a36d315e0ed1d 100644 (file)
@@ -7,6 +7,8 @@
         
     require_variable($id);    
     optional_variable($mode); 
+  
+    $mode = strip_tags(urldecode($mode));  //XSS
         
     require_login();
     if ( !isadmin() ) {
index 995cf1ca85d989cb21bb468aca8f495bb42c2ffc..d19256ee4cd2dc1973261cc0e738e9754c4679da 100644 (file)
@@ -13,6 +13,9 @@
     optional_variable($offset);                    // number of entries to bypass
     optional_variable($displayformat,-1); 
 
+    $mode = strip_tags(urldecode($mode));  //XSS
+    $hook = strip_tags(urldecode($hook));  //XSS
+    $sortkey = strip_tags(urldecode($sortkey));  //XSS
 
     if (! $cm = get_record("course_modules", "id", $id)) {
         error("Course Module ID was incorrect");
index 0497bb02003c2a3046e3d8e5920850b63fd57bd0..0cd1151fc570e85d50ecb95ad5306fb11dea3e6f 100644 (file)
     optional_variable($show,"");       // [ concept | alias ] => mode=term hook=$show
     optional_variable($displayformat,-1);  // override of the glossary display format
 
+    $mode = strip_tags(urldecode($mode));  //XSS
+    $hook = strip_tags(urldecode($hook));  //XSS
+    $fullsearch = strip_tags(urldecode($fullsearch));  //XSS
+    $sortkey = strip_tags(urldecode($sortkey));  //XSS
+    $sortorder = strip_tags(urldecode($sortorder));  //XSS
+    $offset = strip_tags(urldecode($offset));  //XSS
+    $show = strip_tags(urldecode($show));  //XSS
+
     if (!empty($id)) {
         if (! $cm = get_record("course_modules", "id", $id)) {
             error("Course Module ID was incorrect");