From 0591a4aeb4e1eaaf568b2af04d039c18e161fa7e Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sat, 23 Nov 2024 21:18:48 +0100 Subject: [PATCH] Update website --- publi_bib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/publi_bib.php b/publi_bib.php index e1a9231..7a5fe53 100644 --- a/publi_bib.php +++ b/publi_bib.php @@ -142,7 +142,10 @@ function convertFirstNameToInitial($name) { if (strpos($part, '-') !== false) { $hyphenParts = explode('-', $part); $initials = array_map(function($p) { - return ucfirst($p[0]) . '.'; + if (!empty($p)) { + return ucfirst($p[0]) . '.'; + } + return ''; }, $hyphenParts); return implode('-', $initials); }