From 9559a089bed80a8163246fddc71b408deb299d01 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Fri, 7 Jul 2023 16:45:38 +0200 Subject: [PATCH] fix sanitization --- includes/collection/class-followers.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/collection/class-followers.php b/includes/collection/class-followers.php index 44a1ec8..449dd78 100644 --- a/includes/collection/class-followers.php +++ b/includes/collection/class-followers.php @@ -107,7 +107,7 @@ class Followers { 'type' => 'string', 'single' => true, 'sanitize_callback' => function( $value ) { - return esc_sql( $value ); + return sanitize_text_field( $value ); }, ) ); @@ -315,9 +315,10 @@ class Followers { $args = wp_parse_args( $args, $defaults ); $query = new WP_Query( $args ); + $posts = $query->get_posts(); $items = array(); - foreach ( $query->get_posts() as $post ) { + foreach ( $posts as $post ) { $items[] = Follower::init_from_cpt( $post ); // phpcs:ignore }