From c0b6bd21b5509b3f7645ccae4609c4b0addefd33 Mon Sep 17 00:00:00 2001 From: barthc Date: Wed, 17 Apr 2024 17:59:22 +0100 Subject: [PATCH] Fixed an issue where different cache key is generated for the same message content --- class-gwiz-gf-openai.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class-gwiz-gf-openai.php b/class-gwiz-gf-openai.php index 9b1e04e..9ef8558 100644 --- a/class-gwiz-gf-openai.php +++ b/class-gwiz-gf-openai.php @@ -1358,7 +1358,7 @@ public function make_request( $endpoint, $body, $feed ) { $cache_key = sha1( serialize( array( 'url' => $url, - 'body' => $body, + 'body' => map_deep( $body, 'sanitize_text_field' ), 'request_params' => $this->get_request_params( $feed ), ) ) );