Merge "Don't count leading/trailing whitespace against signature scan limit"

This commit is contained in:
jenkins-bot 2022-02-08 20:00:08 +00:00 committed by Gerrit Code Review
commit 4593a9fe91
2 changed files with 4 additions and 2 deletions

View file

@ -600,7 +600,8 @@ class CommentParser {
}
if ( $event === 'leave' && $node !== $timestampNode ) {
$length += $node instanceof Text ? mb_strlen( $node->textContent ?? '' ) : 0;
$length += $node instanceof Text ?
mb_strlen( CommentUtils::htmlTrim( $node->textContent ?? '' ) ) : 0;
}
// Find the closest link before timestamp that links to the user's user page.

View file

@ -587,7 +587,8 @@ Parser.prototype.findSignature = function ( timestampNode, until ) {
}
if ( event === 'leave' && node !== timestampNode ) {
length += node.nodeType === Node.TEXT_NODE ? codePointLength( node.textContent ) : 0;
length += node.nodeType === Node.TEXT_NODE ?
codePointLength( utils.htmlTrim( node.textContent ) ) : 0;
}
// Find the closest link before timestamp that links to the user's user page.