Merge pull request #15475 from mecachisenros/externUrl
[civicrm-core.git] / Civi / Api4 / Utils / FormattingUtil.php
index b3e114627269f9d2aafa719e7316c8e0bc39a0a4..21c3d4e6b59de29757925c3a5b3d86c601104b6d 100644 (file)
@@ -65,6 +65,8 @@ class FormattingUtil {
         $params[$name] = 'null';
       }
     }
+
+    \CRM_Utils_API_HTMLInputCoder::singleton()->encodeRow($params);
   }
 
   /**
@@ -111,6 +113,11 @@ class FormattingUtil {
         $value = date('Ymd', strtotime($value));
         break;
     }
+
+    $hic = \CRM_Utils_API_HTMLInputCoder::singleton();
+    if (!$hic->isSkippedField($fieldSpec['name'])) {
+      $value = $hic->encodeValue($value);
+    }
   }
 
 }