PluginProbe
Elementor Website Builder – more than just a page builder / 3.1.3
Elementor Website Builder – more than just a page builder v3.1.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/utils.php +33 -0 3.1.23.1.3 View file →
@@ -17,8 +17,30 @@
17 17
18 18 const DEPRECATION_RANGE = 0.4;
19 19
20 20 /**
21 + * A list of safe tage for `validate_html_tag` method.
22 + */
23 + const ALLOWED_HTML_WRAPPER_TAGS = [
24 + 'article',
25 + 'aside',
26 + 'div',
27 + 'footer',
28 + 'h1',
29 + 'h2',
30 + 'h3',
31 + 'h4',
32 + 'h5',
33 + 'h6',
34 + 'header',
35 + 'main',
36 + 'nav',
37 + 'p',
38 + 'section',
39 + 'span',
40 + ];
41 +
42 + /**
21 43 * Is ajax.
22 44 *
23 45 * Whether the current request is a WordPress ajax request.
24 46 *
@@ -621,6 +643,17 @@
621 643 // @codingStandardsIgnoreStart
622 644 $submenu[ $menu_slug ][0][0] = $new_label;
623 645 // @codingStandardsIgnoreEnd
624 646 }
647 + }
648 +
649 + /**
650 + * Validate an HTML tag against a safe allowed list.
651 + *
652 + * @param string $tag
653 + *
654 + * @return string
655 + */
656 + public static function validate_html_tag( $tag ) {
657 + return in_array( strtolower( $tag ), self::ALLOWED_HTML_WRAPPER_TAGS ) ? $tag : 'div';
625 658 }
626 659 }