File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
app/code/Magento/Store/etc
lib/internal/Magento/Framework/View Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 21
21
<merge_files >0</merge_files >
22
22
<minify_files >0</minify_files >
23
23
<minify_exclude >
24
- /tiny_mce/
24
+ < tiny_mce > /tiny_mce/</ tiny_mce >
25
25
</minify_exclude >
26
26
</js >
27
27
<css >
28
28
<minify_files >0</minify_files >
29
29
<minify_exclude >
30
- /tiny_mce/
30
+ < tiny_mce > /tiny_mce/</ tiny_mce >
31
31
</minify_exclude >
32
32
</css >
33
33
<image >
Original file line number Diff line number Diff line change @@ -143,12 +143,26 @@ public function getExcludes($contentType)
143
143
if (!isset ($ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ])) {
144
144
$ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ] = [];
145
145
$ key = sprintf (self ::XML_PATH_MINIFICATION_EXCLUDES , $ contentType );
146
- foreach (explode ("\n" , $ this ->scopeConfig ->getValue ($ key , $ this ->scope )) as $ exclude ) {
146
+ $ excludeValues = $ this ->getMinificationExcludeValues ($ key );
147
+ foreach ($ excludeValues as $ exclude ) {
147
148
if (trim ($ exclude ) != '' ) {
148
149
$ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ][] = trim ($ exclude );
149
150
}
150
151
}
151
152
}
152
153
return $ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ];
153
154
}
155
+
156
+ /**
157
+ * Get minification exclude values from configuration
158
+ *
159
+ * @param string $key
160
+ * @return string[]
161
+ */
162
+ private function getMinificationExcludeValues ($ key )
163
+ {
164
+ $ configValues = $ this ->scopeConfig ->getValue ($ key , $ this ->scope ) ?? [];
165
+
166
+ return array_values ($ configValues );
167
+ }
154
168
}
Original file line number Diff line number Diff line change @@ -203,10 +203,10 @@ public function testGetExcludes()
203
203
->expects ($ this ->once ())
204
204
->method ('getValue ' )
205
205
->with ('dev/js/minify_exclude ' )
206
- ->willReturn (
207
- " /tiny_mce/ \n" .
208
- " /tiny_mce2/ "
209
- );
206
+ ->willReturn ([
207
+ ' tiny_mce ' => ' /tiny_mce/ ' ,
208
+ ' some_other_unique_name ' => ' /tiny_mce2/ '
209
+ ] );
210
210
211
211
$ expected = ['/tiny_mce/ ' , '/tiny_mce2/ ' ];
212
212
$ this ->assertEquals ($ expected , $ this ->minification ->getExcludes ('js ' ));
You can’t perform that action at this time.
0 commit comments