From 993bd537655d7dba41b726264844d9c7ac7d6676 Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Wed, 10 Aug 2022 11:41:14 -0700 Subject: [PATCH] Email: Check first name exists before using. The previous check worked when the field existed as an empty string, but threw a notice when it didn't exist. --- plugins/wporg-5ftf/includes/email.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wporg-5ftf/includes/email.php b/plugins/wporg-5ftf/includes/email.php index fe54939..25cabcd 100644 --- a/plugins/wporg-5ftf/includes/email.php +++ b/plugins/wporg-5ftf/includes/email.php @@ -215,7 +215,7 @@ function send_contributor_inactive_email( array $contributor ) : bool { * Their first name is ideal, but their username is the best fallback because `nickname`, `display_name`, * etc are too formal. */ - $name = $contributor['first_name'] ? $contributor['first_name'] : '@' . $contributor['user_nicename']; + $name = empty( $contributor['first_name'] ) ? '@' . $contributor['user_nicename'] : $contributor['first_name']; $subject = 'Please update your Five for the Future pledge'; $short_team_names = array_map( function( $team ) {