diff --git a/inc/Service/Embed/OembedExtractor.php b/inc/Service/Embed/OembedExtractor.php index 759e9c60..f86b2013 100644 --- a/inc/Service/Embed/OembedExtractor.php +++ b/inc/Service/Embed/OembedExtractor.php @@ -40,7 +40,7 @@ class OembedExtractor { ], $this->provider_timeout ); - $json = \json_decode($body, null, 512, \JSON_THROW_ON_ERROR); + $json = \json_decode($body, true, 512, \JSON_THROW_ON_ERROR); $ret = [ 'title' => $json['title'] ?? null, @@ -55,12 +55,12 @@ class OembedExtractor { } } - $this->cache->set("oembed_embedder_$url$provider_url", $ret, $cache_timeout); + $this->cache->set("oembed_embedder_$provider_url$url", $ret, $cache_timeout); } $resp = new OembedResponse(); $resp->title = $ret['title']; $resp->thumbnail_url = $ret['thumbnail_url']; - return $ret; + return $resp; } }