From d97af030cf7a586a4582a5fecd7e9f92c5f446fe Mon Sep 17 00:00:00 2001 From: DemeritCowboy Date: Wed, 9 Oct 2019 18:31:30 -0400 Subject: [PATCH] be less loopy --- CRM/Utils/DeprecatedUtils.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index 0045346efe..ed07a6b2aa 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -884,6 +884,10 @@ function _civicrm_api3_deprecated_activity_buildmailparams($result, $activityTyp if (isset($result["attachFile_$i"])) { $params["attachFile_$i"] = $result["attachFile_$i"]; } + else { + // No point looping 100 times if there's only one attachment + break; + } } return $params; -- 2.25.1