File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
lib/internal/Magento/Framework/View Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ public function minify($file)
131
131
'#(?<!:| \\\\| \'|")//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*# ' ,
132
132
'' ,
133
133
preg_replace (
134
- '#(?<!:)//[^\n\r]*(\s\?\>)# ' ,
134
+ '#(?<!:| \' |" )//[^\n\r]*(\s\?\>)# ' ,
135
135
'$1 ' ,
136
136
preg_replace (
137
137
'#(?<!:)//[^\n\r]*(\<\?php)[^\n\r]*(\s\?\>)[^\n\r]*# ' ,
Original file line number Diff line number Diff line change @@ -124,6 +124,8 @@ public function testMinify()
124
124
<head>
125
125
<title>Test title</title>
126
126
</head>
127
+ <link rel="stylesheet" href='https://www.example.com/2' type="text/css" />
128
+ <link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/1" type="text/css" />
127
129
<body>
128
130
<a href="http://somelink.com/text.html">Text Link</a>
129
131
<img src="test.png" alt="some text" />
@@ -149,14 +151,16 @@ public function testMinify()
149
151
//]]>
150
152
</script>
151
153
<?php echo "http://some.link.com/" ?>
154
+ <?php echo "//some.link.com/" ?>
155
+ <?php echo '//some.link.com/' ?>
152
156
<em>inline text</em>
153
157
<a href="http://www.<?php echo 'hi' ?>"></a>
154
158
</body>
155
159
</html>
156
160
TEXT ;
157
161
158
162
$ expectedContent = <<<TEXT
159
- <?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ ?> <?php ?> <html><head><title>Test title</title></head><body><a href="http://somelink.com/text.html">Text Link</a> <img src="test.png" alt="some text" /><?php echo \$block->someMethod(); ?> <div style="width: 800px" class="<?php echo \$block->getClass() ?>" /><script>
163
+ <?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ ?> <?php ?> <html><head><title>Test title</title></head><link rel="stylesheet" href='https://www.example.com/2' type="text/css" /><link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/1" type="text/css" />< body><a href="http://somelink.com/text.html">Text Link</a> <img src="test.png" alt="some text" /><?php echo \$block->someMethod(); ?> <div style="width: 800px" class="<?php echo \$block->getClass() ?>" /><script>
160
164
var i = 1;
161
165
var j = 1;
162
166
@@ -174,7 +178,7 @@ public function testMinify()
174
178
}
175
179
});
176
180
//]]>
177
- </script><?php echo "http://some.link.com/" ?> <em>inline text</em> <a href="http://www.<?php echo 'hi' ?>"></a></body></html>
181
+ </script><?php echo "http://some.link.com/" ?> <?php echo "//some.link.com/" ?> <?php echo '//some.link.com/' ?> < em>inline text</em> <a href="http://www.<?php echo 'hi' ?>"></a></body></html>
178
182
TEXT ;
179
183
180
184
$ this ->appDirectoryMock ->expects ($ this ->once ())
You can’t perform that action at this time.
0 commit comments