From 954d3edc8718afa0e70ee6f35b71a47ebe7d48cc Mon Sep 17 00:00:00 2001 From: klausru Date: Wed, 10 Jul 2024 16:38:45 +0200 Subject: [PATCH] Update CSVImportExportPlugin.php Problem was that givennames containing whitespaces with abrev. second names (e.g. John D.) and familynames that include dashes (e.g. Whatever-Name) were not imported. This update should improve this --- plugins/importexport/csv/CSVImportExportPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/importexport/csv/CSVImportExportPlugin.php b/plugins/importexport/csv/CSVImportExportPlugin.php index 6a72792f729..9b8b797fd6e 100644 --- a/plugins/importexport/csv/CSVImportExportPlugin.php +++ b/plugins/importexport/csv/CSVImportExportPlugin.php @@ -206,7 +206,7 @@ public function executeCLI($scriptName, &$args) // But default to press email address based on press path if not present. $givenName = $familyName = $emailAddress = null; $authorString = trim($authorString); // whitespace. - if (!preg_match('/^(\w+)([\w\s]+)?(<([^>]+)>)?$/', $authorString, $matches)) { + if (!preg_match('/^([\w.\s]+)\s+([\w\s-]+)?\s*(<([^>]+)>)?$/', $authorString, $matches)) { echo __('plugins.importexport.csv.invalidAuthor', ['author' => $authorString]) . "\n"; continue; }