summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2008-12-08 15:07:16 (GMT)
committer Joao Ventura2008-12-08 15:07:16 (GMT)
commit4d7e0c295a233ce1b236bf300d97802875e2a4df (patch)
tree0a29d89c9433be28b2a266fa1ec440a49887d558
parentcff875bc897f78b9a97d8cc65fb5e8093ba5844f (diff)
Fix #343985 by eMPee584: improve removal of comment form and links
-rw-r--r--print.pages.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/print.pages.inc b/print.pages.inc
index a30cac4..71a27bd 100644
--- a/print.pages.inc
+++ b/print.pages.inc
@@ -592,13 +592,13 @@ function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $t
//Remove the comment forms
$comments = preg_replace('!<form.*?id="comment-.*?">.*?</form>!sim', '', $comments);
//Remove the 'Post new comment' title
- $comments = preg_replace('!<h2.*?>Post new comment</h2>!', '', $comments);
+ $comments = preg_replace('!<h2.*?>'. t('Post new comment') .'</h2>!', '', $comments);
//Remove the comment title hyperlink
- $comments = preg_replace('!(<h3.*?>)(<a.*?>)(.*?)</a>(</h3>)!', '$1$3$4', $comments);
+ $comments = preg_replace('!(<h3.*?>.*?)<a.*?>(.*?)</a>(.*?</h3>)!i', '$1$2$3', $comments);
//Remove the comment author link
- $pattern = '!(<span class="submitted">)(.*?)<a.*?>(.*?)</a>(</span>)!sim';
+ $pattern = '!(<(?:span|div) class="submitted">.*?)<a.*?>(.*?)</a>(.*?</(?:span|div)>)!sim';
if (preg_match($pattern, $comments)) {
- $comments = preg_replace($pattern , '$1$2$3$4', $comments);
+ $comments = preg_replace($pattern , '$1$2$3', $comments);
}
//Remove the comment links
$comments = preg_replace('!\s*<ul class="links">.*?</ul>!sim', '', $comments);