Skip to content

Commit da8a93e

Browse files
committed
Remove warning + notice messages in agenda (path disclosure) - refs #2746
1 parent 5e61c2b commit da8a93e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main/calendar/agenda.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ function add_image_form() {
8181
Event::event_access_tool(TOOL_CALENDAR_EVENT);
8282

8383
if ($type === 'fromjs') {
84-
$id_list = explode('_', $eventId);
84+
// split the "id" parameter only if string and there are _ separators
85+
if (preg_match('/_/', $eventId)) {
86+
$id_list = explode('_', $eventId);
87+
} else {
88+
$id_list = $eventId;
89+
}
8590
$eventId = $id_list[1];
8691
$event_type = $id_list[0];
8792
$event_type = $event_type === 'platform' ? 'admin' : $event_type;
@@ -306,6 +311,8 @@ function add_image_form() {
306311
"url" => $url,
307312
"name" => get_lang('Agenda'),
308313
];
314+
} else {
315+
$actionName = '';
309316
}
310317

311318
// Tool introduction

0 commit comments

Comments
 (0)