drupal_set_message(t('You are not authorized to post comments.'),'error');
drupal_goto("node/$nid");
drupal_goto("node/$node->nid");
}
}
else{
...
...
@@ -652,10 +650,10 @@ function comment_reply($nid, $pid = NULL) {
if($comment=db_fetch_object(db_query('SELECT c.*, u.uid, u.name AS registered_name, u.picture, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = %d',$pid,COMMENT_PUBLISHED))){
// If that comment exists, make sure that the current comment and the parent comment both
// belong to the same parent node.
if($comment->nid!=$nid){
if($comment->nid!=$node->nid){
// Attempting to reply to a comment not belonging to the current nid.
drupal_set_message(t('The comment you are replying to does not exist.'),'error');
drupal_goto("node/$nid");
drupal_goto("node/$node->nid");
}
// Display the parent comment
$comment=drupal_unpack($comment);
...
...
@@ -664,7 +662,7 @@ function comment_reply($nid, $pid = NULL) {
}
else{
drupal_set_message(t('The comment you are replying to does not exist.'),'error');
drupal_goto("node/$nid");
drupal_goto("node/$node->nid");
}
}
// This is the case where the comment is in response to a node. Display the node.
...
...
@@ -673,22 +671,22 @@ function comment_reply($nid, $pid = NULL) {