Skip to content

Commit 03a80ae

Browse files
committed
Add Security::remove_Xss
1 parent d2be861 commit 03a80ae

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

index.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,16 @@
191191
}
192192
// direct login to course
193193
if (isset($_GET['firstpage'])) {
194-
api_set_firstpage_parameter($_GET['firstpage']);
195-
// if we are already logged, go directly to course
196-
if (api_user_is_login()) {
197-
echo "<script>self.location.href='index.php?firstpage=".Security::remove_XSS($_GET['firstpage'])."'</script>";
194+
$firstPage = $_GET['firstpage'];
195+
$courseInfo = api_get_course_info($firstPage);
196+
197+
if (!empty($courseInfo)) {
198+
api_set_firstpage_parameter($firstPage);
199+
200+
// if we are already logged, go directly to course
201+
if (api_user_is_login()) {
202+
echo "<script>self.location.href='index.php?firstpage=".Security::remove_XSS($firstPage)."'</script>";
203+
}
198204
}
199205
} else {
200206
api_delete_firstpage_parameter();

main/auth/profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ function show_image(image,width,height) {
739739
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
740740
Display::return_icon('inbox.png', get_lang('Messages')).'</a>';
741741
}
742-
$show = isset($_GET['show']) ? '&amp;show='.Security::remove_XSS($_GET['show']) : '';
742+
$show = isset($_GET['show']) ? '&show='.(int) $_GET['show'] : '';
743743

744744
if (isset($_GET['type']) && $_GET['type'] === 'extended') {
745745
$actions .= '<a href="profile.php?type=reduced'.$show.'">'.

main/session/add_users_to_session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
$this_section = SECTION_PLATFORM_ADMIN;
1616

1717
$id_session = isset($_GET['id_session']) ? (int) $_GET['id_session'] : 0;
18-
$addProcess = isset($_GET['add']) ? Security::remove_XSS($_GET['add']) : null;
18+
$addProcess = isset($_GET['add']) && 'true' === $_GET['add'] ? 'true' : null;
1919

2020
SessionManager::protectSession($id_session);
2121

0 commit comments

Comments
 (0)