Skip to content

Commit 01ba1c2

Browse files
authored
Fixed an issue where different cache keys could be generated with the same input resulting in different responses.
* Fixed an issue where different cache key is generated for the same message content * Feedback fixed
1 parent da1debc commit 01ba1c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

class-gwiz-gf-openai.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ public function make_request( $endpoint, $body, $feed ) {
13581358

13591359
$cache_key = sha1( serialize( array(
13601360
'url' => $url,
1361-
'body' => $body,
1361+
'body' => map_deep( $body, 'sanitize_text_field' ), // Sanitize the `$body` variable to ensure consistent `$cache_key`
13621362
'request_params' => $this->get_request_params( $feed ),
13631363
) ) );
13641364

0 commit comments

Comments
 (0)