diff --git a/app/code/Magento/Store/etc/config.xml b/app/code/Magento/Store/etc/config.xml
index 470337a97dcd9..1011fe3051321 100644
--- a/app/code/Magento/Store/etc/config.xml
+++ b/app/code/Magento/Store/etc/config.xml
@@ -21,13 +21,13 @@
0
0
- /tiny_mce/
+ /tiny_mce/
0
- /tiny_mce/
+ /tiny_mce/
diff --git a/lib/internal/Magento/Framework/View/Asset/Minification.php b/lib/internal/Magento/Framework/View/Asset/Minification.php
index 686f794d6318a..33c82a1810db6 100644
--- a/lib/internal/Magento/Framework/View/Asset/Minification.php
+++ b/lib/internal/Magento/Framework/View/Asset/Minification.php
@@ -143,7 +143,8 @@ public function getExcludes($contentType)
if (!isset($this->configCache[self::XML_PATH_MINIFICATION_EXCLUDES][$contentType])) {
$this->configCache[self::XML_PATH_MINIFICATION_EXCLUDES][$contentType] = [];
$key = sprintf(self::XML_PATH_MINIFICATION_EXCLUDES, $contentType);
- foreach (explode("\n", $this->scopeConfig->getValue($key, $this->scope)) as $exclude) {
+ $excludeValues = $this->getMinificationExcludeValues($key);
+ foreach ($excludeValues as $exclude) {
if (trim($exclude) != '') {
$this->configCache[self::XML_PATH_MINIFICATION_EXCLUDES][$contentType][] = trim($exclude);
}
@@ -151,4 +152,17 @@ public function getExcludes($contentType)
}
return $this->configCache[self::XML_PATH_MINIFICATION_EXCLUDES][$contentType];
}
+
+ /**
+ * Get minification exclude values from configuration
+ *
+ * @param string $key
+ * @return string[]
+ */
+ private function getMinificationExcludeValues($key)
+ {
+ $configValues = $this->scopeConfig->getValue($key, $this->scope) ?? [];
+
+ return array_values($configValues);
+ }
}
diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php
index 2f6305f1cc73c..1cc2a3dd7e2b7 100644
--- a/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php
+++ b/lib/internal/Magento/Framework/View/Test/Unit/Asset/MinificationTest.php
@@ -203,10 +203,10 @@ public function testGetExcludes()
->expects($this->once())
->method('getValue')
->with('dev/js/minify_exclude')
- ->willReturn(
- " /tiny_mce/ \n" .
- " /tiny_mce2/ "
- );
+ ->willReturn([
+ 'tiny_mce' => '/tiny_mce/',
+ 'some_other_unique_name' => '/tiny_mce2/'
+ ]);
$expected = ['/tiny_mce/', '/tiny_mce2/'];
$this->assertEquals($expected, $this->minification->getExcludes('js'));