Skip to content
Snippets Groups Projects
Verified Commit 5776f287 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3397558 by mfb: OEmbed generates URLs with URL-decoded query string

parent a1699fe0
No related branches found
No related tags found
No related merge requests found
......@@ -176,7 +176,7 @@ public function getResourceUrl($url, $max_width = NULL, $max_height = NULL) {
// provide extra parameters in the query string. For example, Instagram also
// supports the 'omitscript' parameter.
$this->moduleHandler->alter('oembed_resource_url', $parsed_url, $provider);
$resource_url = $parsed_url['path'] . '?' . rawurldecode(UrlHelper::buildQuery($parsed_url['query']));
$resource_url = $parsed_url['path'] . '?' . UrlHelper::buildQuery($parsed_url['query']);
$this->urlCache[$url] = $resource_url;
$this->cacheBackend->set($cache_id, $resource_url);
......
......@@ -45,19 +45,19 @@ public static function providerEndpointMatching() {
return [
'match by endpoint: Twitter' => [
'https://twitter.com/Dries/status/999985431595880448',
'https://publish.twitter.com/oembed?url=https://twitter.com/Dries/status/999985431595880448',
'https://publish.twitter.com/oembed?url=https%3A//twitter.com/Dries/status/999985431595880448',
],
'match by endpoint: Vimeo' => [
'https://vimeo.com/14782834',
'https://vimeo.com/api/oembed.json?url=https://vimeo.com/14782834',
'https://vimeo.com/api/oembed.json?url=https%3A//vimeo.com/14782834',
],
'match by endpoint: Dailymotion' => [
'https://www.dailymotion.com/video/x2vzluh',
'https://www.dailymotion.com/services/oembed?url=https://www.dailymotion.com/video/x2vzluh',
'https://www.dailymotion.com/services/oembed?url=https%3A//www.dailymotion.com/video/x2vzluh',
],
'match by endpoint: Facebook' => [
'https://www.facebook.com/facebook/videos/10153231379946729/',
'https://www.facebook.com/plugins/video/oembed.json?url=https://www.facebook.com/facebook/videos/10153231379946729/',
'https://www.facebook.com/plugins/video/oembed.json?url=https%3A//www.facebook.com/facebook/videos/10153231379946729/',
],
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment