diff --git a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php index d195ea5f1a07b..7a76cd3776e0f 100644 --- a/app/code/Magento/Cms/Helper/Wysiwyg/Images.php +++ b/app/code/Magento/Cms/Helper/Wysiwyg/Images.php @@ -177,7 +177,14 @@ public function getImageHtmlDeclaration($filename, $renderAsTag = false) $html = $fileurl; // $mediaPath; } else { $directive = $this->urlEncoder->encode($directive); - $html = $this->_backendData->getUrl('cms/wysiwyg/directive', ['___directive' => $directive]); + + $html = $this->_backendData->getUrl( + 'cms/wysiwyg/directive', + [ + '___directive' => $directive, + '_escape_params' => false, + ] + ); } } return $html; diff --git a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php index b1da321d2ef92..7a249b34e90c9 100644 --- a/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php +++ b/app/code/Magento/Cms/Test/Unit/Helper/Wysiwyg/ImagesTest.php @@ -453,7 +453,7 @@ public function testGetImageHtmlDeclaration($baseUrl, $fileName, $isUsingStaticU $this->backendDataMock->expects($this->any()) ->method('getUrl') - ->with('cms/wysiwyg/directive', ['___directive' => $directive]) + ->with('cms/wysiwyg/directive', ['___directive' => $directive, '_escape_params' => false]) ->willReturn($directive); $this->assertEquals($expectedHtml, $this->imagesHelper->getImageHtmlDeclaration($fileName));