Verified Commit 655cb760 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3071446 by marcvangend, Kirst25, dcam, guptahemant, Lendude, nod_:...

Issue #3071446 by marcvangend, Kirst25, dcam, guptahemant, Lendude, nod_: Remove invalid iframe attributes from oembed field formatter
parent 565a9f14
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
.media-oembed-content {
  max-width: 100%;
  border: none;
  background-color: transparent;
}
+0 −3
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@
use Drupal\media\Plugin\media\Source\OEmbedInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

// cspell:ignore allowtransparency
/**
 * Plugin implementation of the 'oembed' formatter.
 *
@@ -227,9 +226,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
          '#tag' => 'iframe',
          '#attributes' => [
            'src' => $url->toString(),
            'frameborder' => 0,
            'scrolling' => FALSE,
            'allowtransparency' => TRUE,
            // External service is not supposed to send something larger
            // than the max width or max height, so those values should be used.
            'width' => $resource->getWidth() ?: $max_width,
+3 −0
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@ public static function providerRender() {
            'height' => '360',
            'title' => 'Drupal Rap Video - Schipulcon09',
            'loading' => 'lazy',
            // cSpell:disable-next-line
            'allowtransparency' => NULL,
            'frameborder' => NULL,
          ],
        ],
        'self_closing' => TRUE,
+2 −0
Original line number Diff line number Diff line
.media-oembed-content {
  max-width: 100%;
  border: none;
  background-color: transparent;
}