Verified Commit 383b2a77 authored by Alex Pott's avatar Alex Pott
Browse files

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

(cherry picked from commit 5776f287)
parent e611ac5c
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+4 −4
Original line number Diff line number Diff line
@@ -41,19 +41,19 @@ public 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/',
      ],
    ];
  }