From adc6e9f8e18877f71ed4e59a1c067e901c4dd51c Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Mon, 6 Jan 2025 14:53:44 -0600 Subject: [PATCH] Replace strip_tags --- src/my-calendar-ajax.php | 4 ++-- src/my-calendar-locations.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/my-calendar-ajax.php b/src/my-calendar-ajax.php index e4ab1c9f..f78008fe 100644 --- a/src/my-calendar-ajax.php +++ b/src/my-calendar-ajax.php @@ -39,7 +39,7 @@ function mc_core_autocomplete_search_pages() { foreach ( $posts as $post ) { $response[] = array( 'post_id' => absint( $post->ID ), - 'post_title' => esc_html( html_entity_decode( strip_tags( $post->post_title ) ) ), + 'post_title' => esc_html( html_entity_decode( wp_strip_all_tags(( $post->post_title ) ) ), ); } wp_send_json( @@ -362,7 +362,7 @@ function mc_core_autocomplete_search_locations() { foreach ( $locations as $location ) { $response[] = array( 'location_id' => (int) $location->location_id, - 'location_label' => esc_html( strip_tags( $location->location_label ) ), + 'location_label' => esc_html( wp_strip_all_tags(( $location->location_label ) ), ); } wp_send_json( diff --git a/src/my-calendar-locations.php b/src/my-calendar-locations.php index d8f410d4..b2f2621d 100644 --- a/src/my-calendar-locations.php +++ b/src/my-calendar-locations.php @@ -144,7 +144,7 @@ function mc_update_location_custom_fields( $post_id, $post, $data, $location_id if ( isset( $post[ $name ] ) ) { if ( ! isset( $field['sanitize_callback'] ) || ( isset( $field['sanitize_callback'] ) && ! function_exists( $field['sanitize_callback'] ) ) ) { // if no sanitization is provided, we'll prep it for SQL and strip tags. - $sanitized = sanitize_text_field( strip_tags( urldecode( $post[ $name ] ) ) ); + $sanitized = sanitize_text_field( wp_strip_all_tags(( urldecode( $post[ $name ] ) ) ); } else { $sanitized = call_user_func( $field['sanitize_callback'], urldecode( $post[ $name ] ) ); }