PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.8.5
Independent Analytics – WordPress Analytics Plugin v2.8.5
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / IAWP / Utils / Security.php
Security.php
37 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IAWP\Utils;
4
5 /** @internal */
6 class Security
7 {
8 public static function json_encode($object)
9 {
10 return \json_encode($object, \JSON_HEX_QUOT | \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_APOS);
11 }
12 public static function string($string)
13 {
14 return \trim(\sanitize_text_field($string));
15 }
16 public static function attr($att)
17 {
18 return \esc_attr($att);
19 }
20 public static function hex($hex)
21 {
22 return \sanitize_hex_color($hex);
23 }
24 public static function html($html)
25 {
26 return \wp_kses_post($html);
27 }
28 public static function form($html)
29 {
30 return \wp_kses($html, ['div' => ['class' => [], 'style' => []], 'select' => ['class' => []], 'option' => ['class' => [], 'value' => [], 'data-datatype' => []], 'input' => ['class' => [], 'type' => [], 'data-css' => [], 'data-dow' => [], 'data-format' => [], 'readonly'], 'button' => ['class' => []], 'span' => ['class' => [], 'style' => []]]);
31 }
32 public static function svg($html)
33 {
34 return \wp_kses($html, ['svg' => ['height' => [], 'width' => [], 'fill' => [], 'viewbox' => [], 'style' => []], 'path' => ['d' => []]]);
35 }
36 }
37