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); }