Skip to content

Commit 76a68fa

Browse files
fix: allow html tags in field description
1 parent 8261907 commit 76a68fa

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

classes/input-meta.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function field_label( $tooltip = true, $desc = true, $asterisk = true ) {
155155

156156
$asterisk_symbol = ( ! empty( $this->required() ) && $this->title() != '' ) ? '<span class="show_required"> *</span>' : '';
157157

158-
$show_desc = ( ! empty( $this->desc() ) ) ? '<span class="show_description ppom-input-desc">' . wp_strip_all_tags( html_entity_decode( $this->desc() ) ) . '</span>' : '';
158+
$show_desc = ( ! empty( $this->desc() ) ) ? '<span class="show_description ppom-input-desc">' . $this->desc() . '</span>' : '';
159159

160160
if ( $desc ) {
161161
$show_desc = apply_filters( 'ppom_field_description', $show_desc, self::$input_meta );

inc/validation.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ function ppom_esc_html( $content ) {
3737
'onclick' => array(),
3838
'onchange' => array(),
3939
'onkeyup' => array(),
40+
'data-*' => array(),
41+
'style' => array(),
4042
);
4143
$allowedposttags['form'] = $allowed_atts;
4244
$allowedposttags['label'] = $allowed_atts;
@@ -72,6 +74,7 @@ function ppom_esc_html( $content ) {
7274
$allowedposttags['a'] = $allowed_atts;
7375
$allowedposttags['b'] = $allowed_atts;
7476
$allowedposttags['i'] = $allowed_atts;
77+
$allowedposttags['br'] = $allowed_atts;
7578
$allowed_tags = wp_kses_allowed_html( 'post' );
7679

7780
return wp_kses( stripslashes_deep( $content ), $allowed_tags );

templates/frontend/inputs/cropper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class="<?php echo esc_attr( $fm->field_inner_wrapper_classes() ); ?>">
4141
<!-- if title of field exist -->
4242
<?php if ( $field_label ) : ?>
4343
<label class="<?php echo esc_attr( $fm->label_classes() ); ?>"
44-
for="<?php echo esc_attr( $fm->data_name() ); ?>"><?php echo wp_kses( $field_label, array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></label>
44+
for="<?php echo esc_attr( $fm->data_name() ); ?>"><?php echo ppom_esc_html( $field_label ); ?></label>
4545
<?php endif ?>
4646

4747

templates/frontend/inputs/divider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
if ( $divider_styles == 'style1' ) {
104104
if ( $fm->field_label() ) {
105105
?>
106-
<h2 class="ppom-divider-with-txt ppom-divider-line ppom-divider-line-clr ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h2>
106+
<h2 class="ppom-divider-with-txt ppom-divider-line ppom-divider-line-clr ppom-divider-txt"><?php echo ppom_esc_html( $fm->field_label() ); ?></h2>
107107
<?php } else { ?>
108108
<hr class="ppom-divider-<?php echo esc_attr( $style1_border ); ?>">
109109
<?php
@@ -113,27 +113,27 @@
113113

114114
<!--Style 2-->
115115
<?php if ( $divider_styles == 'style2' ) { ?>
116-
<h2 class="ppom-divider-with-txt ppom-divider-gradient ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h2>
116+
<h2 class="ppom-divider-with-txt ppom-divider-gradient ppom-divider-txt"><?php echo ppom_esc_html( $fm->field_label() ); ?></h2>
117117
<?php } ?>
118118

119119
<!--Style 3-->
120120
<?php if ( $divider_styles == 'style3' ) { ?>
121-
<h2 class="ppom-divider-with-txt ppom-divider-donotcross ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h2>
121+
<h2 class="ppom-divider-with-txt ppom-divider-donotcross ppom-divider-txt"><?php echo ppom_esc_html( $fm->field_label() ); ?></h2>
122122
<?php } ?>
123123

124124
<!--Style 4-->
125125
<?php if ( $divider_styles == 'style4' ) { ?>
126126
<div class="ppom-divider-easy-shadow">
127127
<span></span>
128-
<span class="ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></span>
128+
<span class="ppom-divider-txt"><?php echo ppom_esc_html( $fm->field_label() ); ?></span>
129129
<span></span>
130130
</div>
131131
<?php } ?>
132132

133133
<!--Style 5-->
134134
<?php if ( $divider_styles == 'style5' ) { ?>
135135

136-
<h1 class="ppom-divider-fancy-heading ppom-divider-txt"><?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?></h1>
136+
<h1 class="ppom-divider-fancy-heading ppom-divider-txt"><?php echo ppom_esc_html( $fm->field_label() ); ?></h1>
137137
<div class="ppom-divider-fancy-line">
138138
<span></span>
139139
</div>

templates/frontend/inputs/file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class="<?php echo esc_attr( $fm->field_inner_wrapper_classes() ); ?>">
3838
class="<?php echo esc_attr( $fm->label_classes() ); ?>"
3939
for="<?php echo esc_attr( $fm->data_name() ); ?>"
4040
>
41-
<?php echo wp_kses( $field_label, array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?>
41+
<?php echo ppom_esc_html( $field_label ); ?>
4242
</label>
4343
<?php endif ?>
4444

templates/frontend/inputs/quantities.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
class="<?php echo esc_attr( $fm->label_classes() ); ?>"
5252
for="<?php echo esc_attr( $fm->data_name() ); ?>"
5353
>
54-
<?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?>
54+
<?php echo ppom_esc_html( $fm->field_label() ); ?>
5555
</label>
5656
<?php endif ?>
5757

templates/frontend/inputs/text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
class="<?php echo esc_attr( $fm->label_classes() ); ?>"
5555
for="<?php echo esc_attr( $fm->data_name() ); ?>"
5656
>
57-
<?php echo wp_kses( $fm->field_label(), array( 'span' => array( 'class' => true, 'data-*' => true, 'title' => true ) ) ); ?>
57+
<?php echo ppom_esc_html( $fm->field_label() ); ?>
5858
</label>
5959
<?php endif ?>
6060

0 commit comments

Comments
 (0)