Fix info_text sanitazation to accept specific tags for formatting

This commit is contained in:
Champ Camba
2022-08-08 14:03:03 +08:00
parent 8651c3af43
commit 9fe061de4d
+15 -1
View File
@@ -113,9 +113,23 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$data['value'] = wp_unslash( $data['value'] );
/*for multi_text*/
if ( ! is_array( $data['value'] ) && $data['type'] != 'wp_editor' ) {
if ( ! is_array( $data['value'] ) && ! in_array( $data['type'], array('info_text','wp_editor' ) ) ) {
$data['value'] = esc_attr( $data['value'] );
}
if( in_array( $data['type'], array('info_text') ) ){
$arr_kses = array(
'a' => array(
'href' => array(),
'title' => array(),
'target' => array(),
),
'br' => array(),
'em' => array(),
'strong' => array(),
);
$data['value'] = wp_kses( $data['value'], $arr_kses );
}
}
$conditional = ! empty( $data['conditional'] ) ? 'data-conditional="' . esc_attr( json_encode( $data['conditional'] ) ) . '"' : '';