summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-03-20 19:42:14 +0000
committerDries Buytaert <dries@buytaert.net>2005-03-20 19:42:14 +0000
commit5ad5f28cdaa5f28ae80f5465387fbd1ed0760b81 (patch)
tree337cb3c8f82fcf79df7c8029e39e3eae22476699
parent28cc8eabdba863569b6b7c3a3d38a1b96a29f2bc (diff)
downloadbrdo-5ad5f28cdaa5f28ae80f5465387fbd1ed0760b81.tar.gz
brdo-5ad5f28cdaa5f28ae80f5465387fbd1ed0760b81.tar.bz2
- Patch #19009 by chx: fixed a bug with comment replies letting one access nodes.
-rw-r--r--modules/comment.module19
-rw-r--r--modules/comment/comment.module19
2 files changed, 26 insertions, 12 deletions
diff --git a/modules/comment.module b/modules/comment.module
index a509ad59c..a22da2242 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -122,18 +122,25 @@ function comment_menu($may_cache) {
'callback' => 'comment_vote_settings', 'access' => $access,'type' => MENU_LOCAL_TASK);
$access = user_access('post comments');
- $items[] = array('path' => 'comment/reply', 'title' => t('reply to comment'),
- 'callback' => 'comment_reply', 'access' => $access, 'type' => MENU_CALLBACK);
$items[] = array('path' => 'comment/edit', 'title' => t('edit comment'),
'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
$items[] = array('path' => 'comment', 'title' => t('reply to comment'),
'callback' => 'comment_save_settings', 'access' => 1, 'type' => MENU_CALLBACK);
}
- else if ((arg(0) == 'node') && is_numeric(arg(1)) && is_numeric(arg(2))) {
- $items[] = array('path' => ('node/'. arg(1) .'/'. arg(2)), 'title' => t('view'),
- 'callback' => 'node_page',
- 'type' => MENU_CALLBACK);
+ else {
+ if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
+ $node = node_load(array('nid' => arg(2)));
+ if ($node->nid) {
+ $items[] = array('path' => 'comment/reply', 'title' => t('reply to comment'),
+ 'callback' => 'comment_reply', 'access' => node_access('view', $node), 'type' => MENU_CALLBACK);
+ }
+ }
+ if ((arg(0) == 'node') && is_numeric(arg(1)) && is_numeric(arg(2))) {
+ $items[] = array('path' => ('node/'. arg(1) .'/'. arg(2)), 'title' => t('view'),
+ 'callback' => 'node_page',
+ 'type' => MENU_CALLBACK);
+ }
}
return $items;
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index a509ad59c..a22da2242 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -122,18 +122,25 @@ function comment_menu($may_cache) {
'callback' => 'comment_vote_settings', 'access' => $access,'type' => MENU_LOCAL_TASK);
$access = user_access('post comments');
- $items[] = array('path' => 'comment/reply', 'title' => t('reply to comment'),
- 'callback' => 'comment_reply', 'access' => $access, 'type' => MENU_CALLBACK);
$items[] = array('path' => 'comment/edit', 'title' => t('edit comment'),
'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
$items[] = array('path' => 'comment', 'title' => t('reply to comment'),
'callback' => 'comment_save_settings', 'access' => 1, 'type' => MENU_CALLBACK);
}
- else if ((arg(0) == 'node') && is_numeric(arg(1)) && is_numeric(arg(2))) {
- $items[] = array('path' => ('node/'. arg(1) .'/'. arg(2)), 'title' => t('view'),
- 'callback' => 'node_page',
- 'type' => MENU_CALLBACK);
+ else {
+ if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
+ $node = node_load(array('nid' => arg(2)));
+ if ($node->nid) {
+ $items[] = array('path' => 'comment/reply', 'title' => t('reply to comment'),
+ 'callback' => 'comment_reply', 'access' => node_access('view', $node), 'type' => MENU_CALLBACK);
+ }
+ }
+ if ((arg(0) == 'node') && is_numeric(arg(1)) && is_numeric(arg(2))) {
+ $items[] = array('path' => ('node/'. arg(1) .'/'. arg(2)), 'title' => t('view'),
+ 'callback' => 'node_page',
+ 'type' => MENU_CALLBACK);
+ }
}
return $items;