Merge "EchoPlainTextEmailFormatter: correctly handle getPrimaryLink() returning false"

This commit is contained in:
jenkins-bot 2022-07-19 20:03:13 +00:00 committed by Gerrit Code Review
commit 1c812bddc0

View file

@ -14,10 +14,12 @@ class EchoPlainTextEmailFormatter extends EchoEventFormatter {
}
$primaryLink = $model->getPrimaryLinkWithMarkAsRead();
$primaryUrl = wfExpandUrl( $primaryLink['url'], PROTO_CANONICAL );
$colon = $this->msg( 'colon-separator' )->text();
$text .= "\n\n{$primaryLink['label']}$colon <$primaryUrl>";
if ( $primaryLink ) {
$primaryUrl = wfExpandUrl( $primaryLink['url'], PROTO_CANONICAL );
$text .= "\n\n{$primaryLink['label']}$colon <$primaryUrl>";
}
foreach ( array_filter( $model->getSecondaryLinks() ) as $secondaryLink ) {
$url = wfExpandUrl( $secondaryLink['url'], PROTO_CANONICAL );