File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,22 @@ protected function detectEndpoint(): ?UriInterface
5353 {
5454 $ document = $ this ->extractor ->getDocument ();
5555
56- return $ document ->link ('alternate ' , ['type ' => 'application/json+oembed ' ])
56+ $ endpoint = $ document ->link ('alternate ' , ['type ' => 'application/json+oembed ' ])
5757 ?: $ document ->link ('alternate ' , ['type ' => 'text/json+oembed ' ])
5858 ?: $ document ->link ('alternate ' , ['type ' => 'application/xml+oembed ' ])
5959 ?: $ document ->link ('alternate ' , ['type ' => 'text/xml+oembed ' ])
60- ?: $ this ->detectEndpointFromProviders ();
60+ ?: null ;
61+
62+ if ($ endpoint === null ) {
63+ return $ this ->detectEndpointFromProviders ();
64+ }
65+
66+ // Add configured OEmbed query parameters
67+ parse_str ($ endpoint ->getQuery (), $ query );
68+ $ query = array_merge ($ query , $ this ->extractor ->getSetting ('oembed:query_parameters ' ) ?? []);
69+ $ endpoint = $ endpoint ->withQuery (http_build_query ($ query ));
70+
71+ return $ endpoint ;
6172 }
6273
6374 private function detectEndpointFromProviders (): ?UriInterface
You can’t perform that action at this time.
0 commit comments