Skip to content

Commit fe308d7

Browse files
MAGETWO-34293: Html minification works incorrectly in Layered Navigation
1 parent 0b26811 commit fe308d7

File tree

1 file changed

+16
-12
lines changed
  • lib/internal/Magento/Framework/View/Template/Html

1 file changed

+16
-12
lines changed

lib/internal/Magento/Framework/View/Template/Html/Minifier.php

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,26 @@ public function minify($file)
113113
{
114114
$file = $this->rootDirectory->getRelativePath($file);
115115
$content = preg_replace(
116-
'#((?:<\?php\s+(?!echo)[^\?]*)\?>)\s+#',
117-
'$1',
116+
'#\s+</#',
117+
'</',
118118
preg_replace(
119-
'#(?<!' . implode('|', $this->inlineHtmlTags) . ')\> \<#',
120-
'><',
119+
'#((?:<\?php\s+(?!echo)[^\?]*)\?>)\s+#',
120+
'$1',
121121
preg_replace(
122-
'#(?ix)(?>[^\S ]\s*|\s{2,})(?=(?:(?:[^<]++|<(?!/?(?:textarea|pre|script)\b))*+)'
123-
. '(?:<(?>textarea|pre|script)\b|\z))#',
124-
' ',
122+
'#(?<!' . implode('|', $this->inlineHtmlTags) . ')\> \<#',
123+
'><',
125124
preg_replace(
126-
'#(?<!:)//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',
127-
'',
125+
'#(?ix)(?>[^\S ]\s*|\s{2,})(?=(?:(?:[^<]++|<(?!/?(?:textarea|pre|script)\b))*+)'
126+
. '(?:<(?>textarea|pre|script)\b|\z))#',
127+
' ',
128128
preg_replace(
129-
'#(?<!:)//[^\n\r]*(\s\?\>)#',
130-
'$1',
131-
$this->rootDirectory->readFile($file)
129+
'#(?<!:)//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',
130+
'',
131+
preg_replace(
132+
'#(?<!:)//[^\n\r]*(\s\?\>)#',
133+
'$1',
134+
$this->rootDirectory->readFile($file)
135+
)
132136
)
133137
)
134138
)

0 commit comments

Comments
 (0)