Skip to content
Snippets Groups Projects
Commit c23e67cc authored by catch's avatar catch
Browse files

Issue #3222616 by phenaproxima, vsujeetkumar, labboy0276, hmendes, cilefen:...

Issue #3222616 by phenaproxima, vsujeetkumar, labboy0276, hmendes, cilefen: YouTube PlayLists can't be added to Remote Video due to regex issue

(cherry picked from commit 5a3a0aba)
parent 31c65138
No related branches found
No related tags found
9 merge requests!10011Issue #3200534 by quietone, longwave, Kristen Pol: Use dataprovider for...,!2571Issue #3000717: Missing mapping for "nodereference_url" widget,!2521Issue #3185775: Place Views preview on the side on large monitors,!1603Issue #3231707: mxr576's core patch playground,!1479Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE,!1478Issue #3250298: Return empty string "" with JSON Serializer instead of FALSE,!1203Issue #3236191 Wrong group exposed form widgets and multiple selection error.,!1076Issue #2903336 Added node context for tokens.,!1015Issue #3226944: REST's Request handler doesn't resolve $data argument for put method
......@@ -151,7 +151,7 @@ public function supportsDiscovery() {
public function matchUrl($url) {
foreach ($this->getSchemes() as $scheme) {
// Convert scheme into a valid regular expression.
$regexp = str_replace(['.', '*'], ['\.', '.*'], $scheme);
$regexp = str_replace(['.', '*', '?'], ['\.', '.*', '\?'], $scheme);
if (preg_match("|^$regexp$|", $url)) {
return TRUE;
}
......
<?php
namespace Drupal\Tests\media\Unit;
use Drupal\media\OEmbed\Endpoint;
use Drupal\Tests\UnitTestCase;
/**
* @coversDefaultClass \Drupal\media\OEmbed\Endpoint
*
* @group media
*/
class EndpointTest extends UnitTestCase {
/**
* @covers ::matchUrl
*/
public function testMatchUrl(): void {
$endpoint = new Endpoint(
'https://www.youtube.com/oembed',
$this->createMock('\Drupal\media\OEmbed\Provider'),
['https://*.youtube.com/playlist?list=*']
);
$this->assertTrue($endpoint->matchUrl('https://www.youtube.com/playlist?list=aBc-EzAs123'));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment