Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit f86f698

Browse files
author
Otis Wright
authored
Update SS_RelativeAssetsResponse.php
1 parent 999df49 commit f86f698

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

code/SS_RelativeAssetsResponse.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ class SS_RelativeAssetsResponse extends SS_HTTPResponse
2121
{
2222
public function setBody($body)
2323
{
24-
$this->body = $body ? (string)$body : $body;
24+
$body = $body ? (string)$body : $body;
2525

26-
//
27-
$this->body = str_replace('"/assets/', '"assets/', $this->body);
28-
$this->body = str_replace('"assets/', '"/assets/', $this->body);
26+
$body = str_replace('"/assets/', '"assets/', $body);
27+
$body = str_replace('"assets/', '"/assets/', $body);
28+
29+
30+
if (class_exists('zz\Html\HTMLMinify')) {
31+
$this->body = zz\Html\HTMLMinify::minify($body, [
32+
'doctype' => zz\Html\HTMLMinify::DOCTYPE_HTML5,
33+
'optimizationLevel' => zz\Html\HTMLMinify::OPTIMIZATION_ADVANCED
34+
]);
35+
} else {
36+
$this->body = $body;
37+
}
2938
}
3039

3140

0 commit comments

Comments
 (0)