Skip to content

Commit 982521d

Browse files
committed
Fix error remove url in script start with //
1 parent 0f9dee5 commit 982521d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Plugin/SpeedOptimizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: nguyen
44
* @Date: 2020-02-12 14:01:01
55
* @Last Modified by: Alex Dong
6-
* @Last Modified time: 2021-02-08 23:32:57
6+
* @Last Modified time: 2021-05-14 12:11:50
77
*/
88

99
namespace Magepow\SpeedOptimizer\Plugin;
@@ -322,7 +322,7 @@ public function minifyJs($script)
322322
{
323323
$regex = '~//?\s*\*[\s\S]*?\*\s*//?~'; // RegEx to remove /** */ and // ** **// php comments
324324
$search = array(
325-
'/(?:(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:(?<!\:|\\\|\')\/\/.*))/',
325+
'/(?:(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:(?<!\:|\\\|\') \/\/.*))/',
326326
'/(\s)+/s', // shorten multiple whitespace sequences
327327
);
328328

0 commit comments

Comments
 (0)