From a65e5121a0fa463bd015ee43b168fc9c836e8a3e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 16 May 2022 22:30:33 -0400 Subject: [PATCH] APIv4 - Respect max length for name with export action --- Civi/Api4/Generic/ExportAction.php | 2 ++ 1 file changed, 2 insertions(+) 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, -- 2.25.1