Skip to content

Commit 8ff67c3

Browse files
committed
Security: Glossary: Remove XSS
Fix GHSA-4wcp-3rh3-7wm4 advisory
1 parent 775a545 commit 8ff67c3

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

main/glossary/index.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ function sorter($item1, $item2)
9090
$form->addHtmlEditor(
9191
'name',
9292
get_lang('TermName'),
93-
false,
93+
true,
9494
false,
9595
['ToolbarSet' => 'TitleAsHtml']
9696
);
9797
} else {
98-
$form->addElement('text', 'name', get_lang('TermName'), ['id' => 'glossary_title']);
98+
$form->addText('name', get_lang('TermName'), true, ['id' => 'glossary_title']);
9999
}
100100

101101
$form->addHtmlEditor(
@@ -107,7 +107,6 @@ function sorter($item1, $item2)
107107
);
108108
$form->addButtonCreate(get_lang('TermAddButton'), 'SubmitGlossary');
109109
// setting the rules
110-
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
111110
// The validation or display
112111
if ($form->validate()) {
113112
$check = Security::check_token('post');
@@ -154,12 +153,12 @@ function sorter($item1, $item2)
154153
$form->addHtmlEditor(
155154
'name',
156155
get_lang('TermName'),
157-
false,
156+
true,
158157
false,
159158
['ToolbarSet' => 'TitleAsHtml']
160159
);
161160
} else {
162-
$form->addElement('text', 'name', get_lang('TermName'), ['id' => 'glossary_title']);
161+
$form->addText('name', get_lang('TermName'), true, ['id' => 'glossary_title']);
163162
}
164163

165164
$form->addHtmlEditor(
@@ -192,9 +191,6 @@ function sorter($item1, $item2)
192191
$form->addButtonUpdate(get_lang('TermUpdateButton'), 'SubmitGlossary');
193192
$form->setDefaults($glossary_data);
194193

195-
// setting the rules
196-
$form->addRule('name', get_lang('ThisFieldIsRequired'), 'required');
197-
198194
// The validation or display
199195
if ($form->validate()) {
200196
$check = Security::check_token('post');

main/inc/lib/TrackingCourseLog.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ public static function getItemResourcesData($from, $numberOfItems, $column, $dir
284284
$row[4] = $ip;
285285
}
286286

287+
$row[5] = Security::remove_XSS($row[5]);
288+
287289
$resources[] = $row;
288290
}
289291
}

0 commit comments

Comments
 (0)