Merge pull request #17470 from colemanw/array
[civicrm-core.git] / CRM / Core / HTMLInputCoder.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * Class CRM_Core_HTMLInputCoder
14 */
15 class CRM_Core_HTMLInputCoder {
16
17 /**
18 * @param string $fldName
19 * @return bool
20 * TRUE if encoding should be skipped for this field
21 */
22 public static function isSkippedField($fldName) {
23 return CRM_Utils_API_HTMLInputCoder::singleton()->isSkippedField($fldName);
24 }
25
26 /**
27 * going to filter the
28 * submitted values across XSS vulnerability.
29 *
30 * @param array|string $values
31 * @param bool $castToString
32 * If TRUE, all scalars will be filtered (and therefore cast to strings).
33 * If FALSE, then non-string values will be preserved
34 */
35 public static function encodeInput(&$values, $castToString = TRUE) {
36 return CRM_Utils_API_HTMLInputCoder::singleton()->encodeInput($values, $castToString);
37 }
38
39 }