Skip to content

Commit f915007

Browse files
committed
Security: Confirm delete action with modal instead of alert
Fix advisory GHSA-gw58-89f7-4xgj
1 parent 82cc07e commit f915007

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

main/inc/lib/glossary.lib.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,16 @@ public static function actions_filter($glossary_id, $url_params, $row)
663663
$glossary_term = Security::remove_XSS(strip_tags($glossary_data['name']));
664664
if (api_is_allowed_to_edit(null, true)) {
665665
if ($glossary_data['session_id'] == api_get_session_id()) {
666-
$return .= '<a href="'.api_get_self().'?action=delete_glossary&glossary_id='.$glossary_id.'&'.api_get_cidreq().'" onclick="return confirmation(\''.$glossary_term.'\');">'.
667-
Display::return_icon('delete.png', get_lang('Delete'), '', 22).'</a>';
666+
$return .= Display::url(
667+
Display::return_icon('delete.png', get_lang('Delete')),
668+
'#',
669+
[
670+
'data-item-title' => $glossary_term,
671+
'data-href' => api_get_self().'?action=delete_glossary&glossary_id='.$glossary_id.'&'.api_get_cidreq(),
672+
'data-toggle' => 'modal',
673+
'data-target' => '#confirm-delete',
674+
]
675+
);
668676
} else {
669677
$return = get_lang('EditionNotAvailableFromSession');
670678
}

0 commit comments

Comments
 (0)