From 589f0d9a35c1f6fec95ec2cf349f270e4875f275 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 9 Nov 2018 10:42:39 -0500 Subject: [PATCH] dev/core#503 - More accurate custom field checking before htmlEncode --- CRM/Utils/API/AbstractFieldCoder.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Utils/API/AbstractFieldCoder.php b/CRM/Utils/API/AbstractFieldCoder.php index b2c843326e..7d427b2b51 100644 --- a/CRM/Utils/API/AbstractFieldCoder.php +++ b/CRM/Utils/API/AbstractFieldCoder.php @@ -63,6 +63,11 @@ abstract class CRM_Utils_API_AbstractFieldCoder implements API_Wrapper { if ($skipFields === NULL) { return FALSE; } + // Strip extra numbers from custom fields e.g. custom_32_1 should be custom_32 + if (strpos($fldName, 'custom_') === 0) { + list($fldName, $customId) = explode('_', $fldName); + $fldName .= '_' . $customId; + } // Field should be skipped if (in_array($fldName, $skipFields)) { -- 2.25.1