Browse Source

Remove warning + notice messages in agenda (path disclosure) - refs #2746

Yannick Warnier 6 years ago
parent
commit
da8a93eea4
1 changed files with 8 additions and 1 deletions
  1. 8 1
      main/calendar/agenda.php

+ 8 - 1
main/calendar/agenda.php

@@ -81,7 +81,12 @@ $nameTools = get_lang('Agenda');
 Event::event_access_tool(TOOL_CALENDAR_EVENT);
 
 if ($type === 'fromjs') {
-    $id_list = explode('_', $eventId);
+    // split the "id" parameter only if string and there are _ separators
+    if (preg_match('/_/', $eventId)) {
+        $id_list = explode('_', $eventId);
+    } else {
+        $id_list = $eventId;
+    }
     $eventId = $id_list[1];
     $event_type = $id_list[0];
     $event_type = $event_type === 'platform' ? 'admin' : $event_type;
@@ -306,6 +311,8 @@ if (!empty($actionName)) {
         "url" => $url,
         "name" => get_lang('Agenda'),
     ];
+} else {
+    $actionName = '';
 }
 
 // Tool introduction