ghwikipp: Reuse the username if a GitHub account doesn't have a real name associated.

From ba9af73404f2fc07aecb0d5f6978d672d06d2e4c Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 22 Jan 2025 16:32:04 +0000
Subject: [PATCH] Reuse the username if a GitHub account doesn't have a real
 name associated.

---
 index.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/index.php b/index.php
index 081ee15..7d5f000 100644
--- a/index.php
+++ b/index.php
@@ -1092,7 +1092,7 @@ function perform_action_on_user($action, $statedir, $user, $is_do)  // !$is_do =
         'action' => $is_do ? "{$action}ed" : "un{$action}ed",
         'revaction' => $action,
         'user' => $user,
-        'username' => $response['name'],
+        'username' => ($response['name'] != NULL) ? $response['name'] : $user,
         'user_avatar' => $response['avatar_url'],
         'title' => "@$user {$action}ed - $wikiname"
     ]);
@@ -1108,7 +1108,8 @@ function confirm_action_on_user($action, $user, $statedir, $explanation)
     print_template('action_on_user_confirmation', [
         'currently' => $is_do ? "{$action}ed" : "un{$action}ed",
         'action' => $is_do ? "un{$action}" : $action,
-        'user' => $user, 'username' => $response['name'],
+        'user' => $user,
+        'username' => ($response['name'] != NULL) ? $response['name'] : $user,
         'user_avatar' => $response['avatar_url'],
         'explanation' => $explanation,
         'title' => "$action @$user?- $wikiname"