#55622, Security threat -- any user can delete comments, patch by robertgarrigos
parent
717d6e30c5
commit
0fad496ca0
|
@ -120,12 +120,13 @@ function comment_menu($may_cache) {
|
||||||
|
|
||||||
$items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
|
$items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
|
||||||
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
|
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
|
||||||
|
|
||||||
|
$items[] = array('path' => 'comment/delete', 'title' => t('delete comment'),
|
||||||
|
'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
|
||||||
|
|
||||||
$access = user_access('post comments');
|
$access = user_access('post comments');
|
||||||
$items[] = array('path' => 'comment/edit', 'title' => t('edit comment'),
|
$items[] = array('path' => 'comment/edit', 'title' => t('edit comment'),
|
||||||
'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
|
'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
|
||||||
$items[] = array('path' => 'comment/delete', 'title' => t('delete comment'),
|
|
||||||
'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
|
if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
|
||||||
|
|
|
@ -120,12 +120,13 @@ function comment_menu($may_cache) {
|
||||||
|
|
||||||
$items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
|
$items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
|
||||||
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
|
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
|
||||||
|
|
||||||
|
$items[] = array('path' => 'comment/delete', 'title' => t('delete comment'),
|
||||||
|
'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
|
||||||
|
|
||||||
$access = user_access('post comments');
|
$access = user_access('post comments');
|
||||||
$items[] = array('path' => 'comment/edit', 'title' => t('edit comment'),
|
$items[] = array('path' => 'comment/edit', 'title' => t('edit comment'),
|
||||||
'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
|
'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
|
||||||
$items[] = array('path' => 'comment/delete', 'title' => t('delete comment'),
|
|
||||||
'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
|
if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
|
||||||
|
|
Loading…
Reference in New Issue