File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 3
3
* @Author: nguyen
4
4
* @Date: 2020-02-12 14:01:01
5
5
* @Last Modified by: Alex Dong
6
- * @Last Modified time: 2020-05-21 15:07:46
6
+ * @Last Modified time: 2020-11-06 14:06:27
7
7
*/
8
8
9
9
namespace Magepow \SpeedOptimizer \Plugin ;
@@ -320,7 +320,9 @@ public function minifyJs($script)
320
320
'' ,
321
321
'\\1 ' ,
322
322
);
323
- return preg_replace ($ search , $ replace , $ script );
323
+ $ minScript = preg_replace ($ search , $ replace , $ script );
324
+ /* Return $script when $minScript empty */
325
+ return $ minScript ? $ minScript : $ script ;
324
326
}
325
327
326
328
public function minifyHtml ($ content )
@@ -341,7 +343,9 @@ public function minifyHtml($content)
341
343
// ''
342
344
);
343
345
344
- return preg_replace ($ search , $ replace , $ content );
346
+ $ minHtml = preg_replace ($ search , $ replace , $ content );
347
+ /* Return $content when $minHtml empty */
348
+ return $ minHtml ? $ minHtml : $ content ;
345
349
}
346
350
347
351
public function addLoading ($ content )
You can’t perform that action at this time.
0 commit comments