From: Coleman Watts Date: Tue, 17 May 2022 02:30:33 +0000 (-0400) Subject: APIv4 - Respect max length for name with export action X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a65e5121a0fa463bd015ee43b168fc9c836e8a3e;p=civicrm-core.git APIv4 - Respect max length for name with export action --- diff --git a/Civi/Api4/Generic/ExportAction.php b/Civi/Api4/Generic/ExportAction.php index bb7e14a0c7..3fc028dacb 100644 --- a/Civi/Api4/Generic/ExportAction.php +++ b/Civi/Api4/Generic/ExportAction.php @@ -129,6 +129,8 @@ class ExportAction extends AbstractAction { } } $name = ($parentName ?? '') . $entityType . '_' . ($record['name'] ?? count($this->exportedEntities[$entityType])); + // Ensure safe characters, max length + $name = \CRM_Utils_String::munge($name, '_', 127); $result[] = [ 'name' => $name, 'entity' => $entityType,