Merge pull request #24022 from colemanw/afformFrontend
[civicrm-core.git] / CRM / Core / HTMLInputCoder.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
4c6ce474
EM
11
12/**
13 * Class CRM_Core_HTMLInputCoder
14 */
a9396478 15class CRM_Core_HTMLInputCoder {
6a488035
TO
16
17 /**
18 * @param string $fldName
a6c01b45
CW
19 * @return bool
20 * TRUE if encoding should be skipped for this field
6a488035
TO
21 */
22 public static function isSkippedField($fldName) {
a9396478 23 return CRM_Utils_API_HTMLInputCoder::singleton()->isSkippedField($fldName);
6a488035
TO
24 }
25
26 /**
dc195289 27 * going to filter the
6a488035
TO
28 * submitted values across XSS vulnerability.
29 *
30 * @param array|string $values
6a0b768e
TO
31 * @param bool $castToString
32 * If TRUE, all scalars will be filtered (and therefore cast to strings).
6a488035
TO
33 * If FALSE, then non-string values will be preserved
34 */
35 public static function encodeInput(&$values, $castToString = TRUE) {
a9396478 36 return CRM_Utils_API_HTMLInputCoder::singleton()->encodeInput($values, $castToString);
6a488035
TO
37 }
38
232624b1 39}