Skip to content

Commit bee78dd

Browse files
MAGETWO-34293: Html minification works incorrectly in Layered Navigation
1 parent 051fc59 commit bee78dd

File tree

2 files changed

+3
-3
lines changed
  • dev/tests/functional/tests/app/Magento/User/Test/Handler/Role
  • lib/internal/Magento/Framework/View/Template/Html

2 files changed

+3
-3
lines changed

dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/Curl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function persist(FixtureInterface $fixture = null)
6161
}
6262

6363
$url = 'admin/user_role/roleGrid/sort/role_id/dir/desc/';
64-
$regExpPattern = '/col\-role_id\W*(\d+)<.td><[^<>]*?>' . $data['rolename'] . '/siu';
64+
$regExpPattern = '/col\-role_id[\s\W]*(\d+)\s*<.td>\s*<[^<>]*?>' . $data['rolename'] . '/siu';
6565

6666
$extractor = new Extractor($url, $regExpPattern);
6767

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function minify($file)
116116
'#(?<!]]>)\s+</#',
117117
'</',
118118
preg_replace(
119-
'#((?:<\?php\s+(?!echo)[^\?]*)\?>)\s+#',
119+
'#((?:<\?php\s+(?!echo|if|elseif|else)[^\?]*)\?>)\s+#',
120120
'$1',
121121
preg_replace(
122122
'#(?<!' . implode('|', $this->inlineHtmlTags) . ')\> \<#',
@@ -126,7 +126,7 @@ public function minify($file)
126126
. '(?:<(?>textarea|pre|script)\b|\z))#',
127127
' ',
128128
preg_replace(
129-
'#(?<!:)//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',
129+
'#(?<!:|\\\\)//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',
130130
'',
131131
preg_replace(
132132
'#(?<!:)//[^\n\r]*(\s\?\>)#',

0 commit comments

Comments
 (0)