Skip to content

Commit

Permalink
Replace strip_tags
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Jan 6, 2025
1 parent aefbbe5 commit adc6e9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/my-calendar-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/my-calendar-locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ) );
}
Expand Down

0 comments on commit adc6e9f

Please sign in to comment.