Merge "commentparser: Allow signature of user '0' to be detected"

This commit is contained in:
jenkins-bot 2024-11-18 18:54:48 +00:00 committed by Gerrit Code Review
commit 5dec8076e2

View file

@ -605,7 +605,7 @@ class CommentParser {
$username = $userpage->getText();
}
}
if ( !$username ) {
if ( $username === null ) {
return null;
}
if ( IPUtils::isIPv6( $username ) ) {
@ -924,7 +924,7 @@ class CommentParser {
$foundSignature = $this->findSignature( $node, $curCommentEnd );
$author = $foundSignature['username'];
if ( !$author ) {
if ( $author === null ) {
// Ignore timestamps for which we couldn't find a signature. It's probably not a real
// comment, but just a false match due to a copypasted timestamp.
continue;
@ -969,7 +969,7 @@ class CommentParser {
$treeWalker->currentNode = $n;
// …and add it as another signature to this comment (regardless of the author and timestamp)
$foundSignature2 = $this->findSignature( $n, $node );
if ( $foundSignature2['username'] ) {
if ( $foundSignature2['username'] !== null ) {
$sigRanges[] = $this->adjustSigRange( $foundSignature2['nodes'], $match2, $n );
$timestampRanges[] = $match2['range'];
}