From f5059e6ea60504b23aed2ef7a8e2d1c28ca4e804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 1 Mar 2021 21:40:21 +0100 Subject: [PATCH] Don't detect comments within 'cite' elements too Follow-up to 024a978ffd6c570d4ee8384720b85032d05cba69. Bug: T275881 Change-Id: I53448ad22cd0531e7fd4aa0ea5d15782879cce14 --- includes/CommentParser.php | 1 + modules/Parser.js | 1 + 2 files changed, 2 insertions(+) diff --git a/includes/CommentParser.php b/includes/CommentParser.php index 8eada3cfd..59049cc4d 100644 --- a/includes/CommentParser.php +++ b/includes/CommentParser.php @@ -672,6 +672,7 @@ class CommentParser { // Don't detect comments within quotes (T275881) if ( $node instanceof DOMElement && ( strtolower( $node->tagName ) === 'blockquote' || + strtolower( $node->tagName ) === 'cite' || strtolower( $node->tagName ) === 'q' ) ) { return NodeFilter::FILTER_REJECT; diff --git a/modules/Parser.js b/modules/Parser.js index cb48b532d..2ab8ede42 100644 --- a/modules/Parser.js +++ b/modules/Parser.js @@ -423,6 +423,7 @@ function acceptOnlyNodesAllowingComments( node ) { // Don't detect comments within quotes (T275881) if ( node instanceof HTMLElement && ( node.tagName.toLowerCase() === 'blockquote' || + node.tagName.toLowerCase() === 'cite' || node.tagName.toLowerCase() === 'q' ) ) { return NodeFilter.FILTER_REJECT;