PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | modules/gutenberg/dist/blocks/image/class-spec-image.php +11 -3 2.7.0 → 2.12.8 View file →
@@ -782,13 +782,21 @@
782 782 $image_heading = '';
783 783
784 784 if ( ! empty( $attributes['heading'] ) ) {
785 785
786 - $heading_id = isset( $attributes['headingId'] ) ? ' id="' . $attributes['headingId'] . '"' : '';
786 + // Validate the tag-name attribute against the editor UI options
787 + // (esc_html() does not strip spaces or `=`, which is unsafe when
788 + // echoed in tag-name position).
789 + $allowed_heading_tags = [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ];
790 + $heading_tag = isset( $attributes['headingTag'] ) && in_array( $attributes['headingTag'], $allowed_heading_tags, true )
791 + ? $attributes['headingTag']
792 + : 'h2';
793 +
794 + $heading_id = ! empty( $attributes['headingId'] ) ? ' id="' . esc_attr( $attributes['headingId'] ) . '"' : '';
787 795 $image_heading = sprintf(
788 796 '<%1$s%2$s class="uagb-image-heading">%3$s</%1$s>',
789 - esc_html( $attributes['headingTag'] ),
790 - esc_attr( $heading_id ),
797 + esc_html( $heading_tag ),
798 + $heading_id,
791 799 esc_html( $attributes['heading'] )
792 800 );
793 801 }
794 802