From f0936d4c1ec88670d20dd67f9d5ab020ee4438d9 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 27 Jul 2020 18:04:03 +1200 Subject: [PATCH] FIX Set iframe dimension attributes specified in shortcode --- src/View/Shortcodes/EmbedShortcodeProvider.php | 11 +++++++++++ .../View/Shortcodes/EmbedShortcodeProviderTest.php | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/View/Shortcodes/EmbedShortcodeProvider.php b/src/View/Shortcodes/EmbedShortcodeProvider.php index d3f4aebf5..720c84888 100644 --- a/src/View/Shortcodes/EmbedShortcodeProvider.php +++ b/src/View/Shortcodes/EmbedShortcodeProvider.php @@ -141,6 +141,17 @@ class EmbedShortcodeProvider implements ShortcodeHandler $arguments['style'] = 'width: ' . intval($arguments['width']) . 'px;'; } + // override iframe dimension attributes provided by webservice with ones specified in shortcode arguments + foreach (['width', 'height'] as $attr) { + if (!($value = $arguments[$attr] ?? false)) { + continue; + } + foreach (['"', "'"] as $quote) { + $rx = "/( +

A nice video

EOS ,