Skip to content

Commit 10593bd

Browse files
committed
fixes pro issue-107
1 parent 632842a commit 10593bd

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

includes/class-notification.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,39 @@ public function send_notification( $notification ) {
121121
$headers[] = 'Content-Type: text/html; charset=UTF-8';
122122
$email_body = apply_filters( 'weforms_email_message', $this->get_formatted_body( $message ), $notification['message'], $headers );
123123

124+
/**
125+
* Added the display style to the safe styles during wp_kses_post().
126+
* WP kses post removes the display css property that we need when formatting the Checkbox and Multiple Choice Grids.
127+
* This function will only run during the notification process.
128+
*
129+
* @since 1.6.17
130+
*/
131+
add_filter( 'safe_style_css', function( $styles ) {
132+
$styles[] = 'display';
133+
return $styles;
134+
} );
135+
136+
/**
137+
* Added the input tag to the allowed html during wp_kses_post().
138+
* WP kses post removes the input tag that we need when formatting the Checkbox and Multiple Choice Grids.
139+
* The $message variable is formatted during the entry creation process. The values from the form are sanitized to avoid
140+
* any issues with malicious inputs.
141+
*
142+
* This function is only used during the notification process.
143+
*
144+
* @since 1.6.17
145+
*/
146+
add_filter( 'wp_kses_allowed_html', function( $html ) {
147+
$html['input'] = array(
148+
'class' => array(),
149+
'name' => array(),
150+
'type' => array(),
151+
'value' => array(),
152+
'checked' => array(),
153+
'disabled' => array(),
154+
);
155+
return $html;
156+
} );
124157
weforms()->emailer->send( $to, $subject, wp_kses_post( htmlspecialchars_decode( $email_body ) ) , $headers );
125158
}
126159

0 commit comments

Comments
 (0)