Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
5ad5f28c
Commit
5ad5f28c
authored
Mar 20, 2005
by
Dries
Browse files
- Patch
#19009
by chx: fixed a bug with comment replies letting one access nodes.
parent
28cc8eab
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/comment.module
View file @
5ad5f28c
...
...
@@ -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
;
...
...
modules/comment/comment.module
View file @
5ad5f28c
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment