diff --git a/includes/class-rest-api.php b/includes/class-rest-api.php index 292a6c9..c752532 100644 --- a/includes/class-rest-api.php +++ b/includes/class-rest-api.php @@ -523,7 +523,7 @@ public static function get_delta( WP_REST_Request $request ): WP_REST_Response|W // tatsächlich verschiedene Zeitpunkte begrenzt statt auf beliebige Varianten. $since_canonical = $since_dt->format( DATE_ATOM ); $cache_key = 'odw_delta_' . md5( serialize( array( $since_canonical, $page, $per_page ) ) ); - $cached = get_transient( $cache_key ); + $cached = get_transient( $cache_key ); if ( false !== $cached && is_array( $cached ) ) { $content_type = self::resolve_content_type( (string) $request->get_param( 'format' ) ); diff --git a/tests/test-rest-delta.php b/tests/test-rest-delta.php index 3a51b01..dd39b2e 100644 --- a/tests/test-rest-delta.php +++ b/tests/test-rest-delta.php @@ -725,6 +725,7 @@ public function test_equivalent_since_spellings_share_one_cache_key(): void { $dt = $method->invoke( null, $raw ); $this->assertInstanceOf( \DateTimeImmutable::class, $dt, "should parse: {$raw}" ); // Mirrors the key derivation in get_delta(). + // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize -- mirrors the cache-key derivation under test. $keys[] = md5( serialize( array( $dt->format( DATE_ATOM ), 1, 20 ) ) ); }