diff --git a/includes/CommentParser.php b/includes/CommentParser.php index 4a511ec23..1b6dde777 100644 --- a/includes/CommentParser.php +++ b/includes/CommentParser.php @@ -922,7 +922,8 @@ class CommentParser { $curCommentEnd = $node; } elseif ( $node instanceof Text && ( $match = $this->findTimestamp( $node, $timestampRegexps ) ) ) { $warnings = []; - $foundSignature = $this->findSignature( $node, $lastSigNode ); + $foundSignature = $this->findSignature( $node, + $curCommentEnd === $this->rootNode ? null : $curCommentEnd ); $author = $foundSignature['username']; $lastSigNode = $foundSignature['nodes'][0]; diff --git a/modules/Parser.js b/modules/Parser.js index 7b653061e..1686f82bc 100644 --- a/modules/Parser.js +++ b/modules/Parser.js @@ -895,7 +895,8 @@ Parser.prototype.buildThreadItems = function () { curCommentEnd = node; } else if ( node.nodeType === Node.TEXT_NODE && ( match = this.findTimestamp( node, timestampRegexps ) ) ) { var warnings = []; - var foundSignature = this.findSignature( node, lastSigNode ); + var foundSignature = this.findSignature( node, + curCommentEnd === this.rootNode ? null : curCommentEnd ); var author = foundSignature.username; lastSigNode = foundSignature.nodes[ 0 ];