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 2121 <merge_files >0</merge_files >
2222 <minify_files >0</minify_files >
2323 <minify_exclude >
24- /tiny_mce/
24+ < tiny_mce > /tiny_mce/</ tiny_mce >
2525 </minify_exclude >
2626 </js >
2727 <css >
2828 <minify_files >0</minify_files >
2929 <minify_exclude >
30- /tiny_mce/
30+ < tiny_mce > /tiny_mce/</ tiny_mce >
3131 </minify_exclude >
3232 </css >
3333 <image >
Original file line number Diff line number Diff line change @@ -143,12 +143,26 @@ public function getExcludes($contentType)
143143 if (!isset ($ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ])) {
144144 $ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ] = [];
145145 $ 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 ) {
147148 if (trim ($ exclude ) != '' ) {
148149 $ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ][] = trim ($ exclude );
149150 }
150151 }
151152 }
152153 return $ this ->configCache [self ::XML_PATH_MINIFICATION_EXCLUDES ][$ contentType ];
153154 }
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+ }
154168}
Original file line number Diff line number Diff line change @@ -203,10 +203,10 @@ public function testGetExcludes()
203203 ->expects ($ this ->once ())
204204 ->method ('getValue ' )
205205 ->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+ ] );
210210
211211 $ expected = ['/tiny_mce/ ' , '/tiny_mce2/ ' ];
212212 $ this ->assertEquals ($ expected , $ this ->minification ->getExcludes ('js ' ));
You can’t perform that action at this time.
0 commit comments