PluginProbe
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables / 2.3.0
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables v2.3.0
2.3.0 2.2.14 2.2.13 2.2.12 2.2.11 2.2.10 2.2.9 2.2.8 2.2.7 2.2.6 2.2.5 2.2.4 2.2.3 trunk 1.0.0 1.0.1 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2
table-builder-block / scoped / deps / wpmet / utility-package / src / Helper / Helper.php

Helper.php in TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables 2.3.0, at scoped/deps/wpmet/utility-package/src/Helper/Helper.php

75 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TableBuilderScopedDeps\Wpmet\UtilityPackage\Helper;
4
5 defined('ABSPATH') || exit;
6 /**
7 * package helper class.
8 *
9 * @since 1.0.0
10 */
11 class Helper
12 {
13 public static function kses($raw)
14 {
15 $allowed_tags = array('a' => array(
16 'class' => array(),
17 'href' => array(),
18 'rel' => array(),
19 'title' => array(),
20 'target' => array(),
21 // Needed so Banner::init_banner()'s remote-configurable style_css
22 // (and its own hardcoded centering style) survive this filter -
23 // WP's wp_kses() runs any allowed 'style' attribute through its
24 // own safecss_filter_attr(), so this doesn't add a new XSS/CSS
25 // injection vector, it just stops previously-legitimate inline
26 // styles from being silently stripped.
27 'style' => array(),
28 ), 'abbr' => array('title' => array()), 'b' => array(), 'blockquote' => array('cite' => array()), 'cite' => array('title' => array()), 'code' => array(), 'del' => array('datetime' => array(), 'title' => array()), 'dd' => array(), 'div' => array('class' => array(), 'title' => array(), 'style' => array()), 'dl' => array(), 'dt' => array(), 'em' => array(), 'h1' => array('class' => array()), 'h2' => array('class' => array()), 'h3' => array('class' => array()), 'h4' => array('class' => array()), 'h5' => array('class' => array()), 'h6' => array('class' => array()), 'i' => array('class' => array()), 'img' => array(
29 'alt' => array(),
30 'class' => array(),
31 'height' => array(),
32 'src' => array(),
33 'width' => array(),
34 // See note on the 'a' tag's 'style' entry above - same rationale.
35 'style' => array(),
36 ), 'li' => array('class' => array()), 'ol' => array('class' => array()), 'p' => array('class' => array()), 'q' => array('cite' => array(), 'title' => array()), 'span' => array('class' => array(), 'title' => array(), 'style' => array()), 'iframe' => array('width' => array(), 'height' => array(), 'scrolling' => array(), 'frameborder' => array(), 'allow' => array(), 'src' => array()), 'strike' => array(), 'br' => array(), 'strong' => array(), 'data-wow-duration' => array(), 'data-wow-delay' => array(), 'data-wallpaper-options' => array(), 'data-stellar-background-ratio' => array(), 'ul' => array('class' => array()));
37 if (function_exists('wp_kses')) {
38 // WP is here
39 return wp_kses($raw, $allowed_tags);
40 } else {
41 return $raw;
42 }
43 }
44 public static function get_kses_array()
45 {
46 $allowed_tags = array('a' => array(
47 'class' => array(),
48 'href' => array(),
49 'rel' => array(),
50 'title' => array(),
51 'target' => array(),
52 // Needed so Banner::init_banner()'s remote-configurable style_css
53 // (and its own hardcoded centering style) survive this filter -
54 // WP's wp_kses() runs any allowed 'style' attribute through its
55 // own safecss_filter_attr(), so this doesn't add a new XSS/CSS
56 // injection vector, it just stops previously-legitimate inline
57 // styles from being silently stripped.
58 'style' => array(),
59 ), 'abbr' => array('title' => array()), 'b' => array(), 'blockquote' => array('cite' => array()), 'cite' => array('title' => array()), 'code' => array(), 'del' => array('datetime' => array(), 'title' => array()), 'dd' => array(), 'div' => array('class' => array(), 'title' => array(), 'style' => array()), 'dl' => array(), 'dt' => array(), 'em' => array(), 'h1' => array('class' => array()), 'h2' => array('class' => array()), 'h3' => array('class' => array()), 'h4' => array('class' => array()), 'h5' => array('class' => array()), 'h6' => array('class' => array()), 'i' => array('class' => array()), 'img' => array(
60 'alt' => array(),
61 'class' => array(),
62 'height' => array(),
63 'src' => array(),
64 'width' => array(),
65 // See note on the 'a' tag's 'style' entry above - same rationale.
66 'style' => array(),
67 ), 'li' => array('class' => array()), 'ol' => array('class' => array()), 'p' => array('class' => array()), 'q' => array('cite' => array(), 'title' => array()), 'span' => array('class' => array(), 'title' => array(), 'style' => array()), 'iframe' => array('width' => array(), 'height' => array(), 'scrolling' => array(), 'frameborder' => array(), 'allow' => array(), 'src' => array()), 'strike' => array(), 'br' => array(), 'strong' => array(), 'data-wow-duration' => array(), 'data-wow-delay' => array(), 'data-wallpaper-options' => array(), 'data-stellar-background-ratio' => array(), 'ul' => array('class' => array()));
68 return $allowed_tags;
69 }
70 public static function get_pac_version()
71 {
72 return \TableBuilderScopedDeps\Composer\InstalledVersions::getPrettyVersion('wpmet/utility-package');
73 }
74 }
75