From b06c7e026d880d66b186d9586e68900caf2a1688 Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Fri, 22 Oct 2004 15:51:08 +0000 Subject: [PATCH] removed preg_match check from comment_type() since by now we should never ever need it git-svn-id: https://develop.svn.wordpress.org/trunk@1826 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/template-functions-comment.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-includes/template-functions-comment.php b/wp-includes/template-functions-comment.php index 2b6d0a4f9a..20a3ceb0dd 100644 --- a/wp-includes/template-functions-comment.php +++ b/wp-includes/template-functions-comment.php @@ -171,14 +171,15 @@ function comment_author_link() { function comment_type($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pingbacktxt = 'Pingback') { global $comment; - if (preg_match('||', $comment->comment_content) - || ('trackback' == $comment->comment_type)) { - echo $trackbacktxt; - } elseif (preg_match('||', $comment->comment_content) - || ('pingback' == $comment->comment_type)) { - echo $pingbacktxt; - } else { - echo $commenttxt; + switch($comment->comment_type) { + case 'trackback': + echo $trackbacktxt; + break; + case 'pingback': + echo $pingbacktxt; + break; + default: + echo $commenttxt; } }