function CommentHelperCase::commentExists
Checks current page for specified comment.
Parameters
object $comment Comment object.:
boolean $reply The comment is a reply to another comment.:
Return value
boolean Comment found.
16 calls to CommentHelperCase::commentExists()
- CommentAnonymous::testAnonymous in drupal-7.x/
modules/ comment/ comment.test - Test anonymous comment functionality.
- CommentAnonymous::testAnonymous in drupal-7.x/
modules/ comment/ comment.test - Test anonymous comment functionality.
- CommentApprovalTest::testApprovalAdminInterface in drupal-7.x/
modules/ comment/ comment.test - Test comment approval functionality through admin/content/comment.
- CommentApprovalTest::testApprovalAdminInterface in drupal-7.x/
modules/ comment/ comment.test - Test comment approval functionality through admin/content/comment.
- CommentApprovalTest::testApprovalNodeInterface in drupal-7.x/
modules/ comment/ comment.test - Test comment approval functionality through node interface.
Archivo
- drupal-7.x/
modules/ comment/ comment.test, line 101 - Tests for comment.module.
Class
Código
function commentExists($comment, $reply = FALSE) {
if ($comment && is_object($comment)) {
$regex = '/' . ($reply ? '<div class="indented">(.*?)' : '');
$regex .= '<a id="comment-' . $comment->id . '"(.*?)'; // Comment anchor.
$regex .= '<div(.*?)'; // Begin in comment div.
$regex .= $comment->subject . '(.*?)'; // Match subject.
$regex .= $comment->comment . '(.*?)'; // Match comment.
$regex .= '/s';
return (boolean) preg_match($regex, $this->drupalGetContent());
}
else {
return FALSE;
}
}