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

Commit 5189132

Browse files
authored
Merge pull request #5 from zanderwar/patch-1
Update SS_RelativeAssetsResponse.php
2 parents 078d000 + ae59631 commit 5189132

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

code/SS_RelativeAssetsResponse.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
class SS_RelativeAssetsResponseExtension extends Extension
99
{
10-
1110
function onBeforeInit()
1211
{
1312
if (is_a($this->owner, 'Controller')) {
@@ -21,16 +20,12 @@ class SS_RelativeAssetsResponse extends SS_HTTPResponse
2120
{
2221
public function setBody($body)
2322
{
24-
$body = $body ? (string)$body : $body;
23+
$body = (string)$body;
2524

2625
$body = str_replace('"/assets/', '"assets/', $body);
2726
$body = str_replace('"assets/', '"/assets/', $body);
28-
29-
json_decode($body);
30-
$bodyIsJson = json_last_error() === JSON_ERROR_NONE;
31-
3227

33-
if (!$bodyIsJson && class_exists('zz\Html\HTMLMinify')) {
28+
if (!json_decode($body) && class_exists('zz\Html\HTMLMinify')) {
3429
$this->body = zz\Html\HTMLMinify::minify($body, [
3530
'doctype' => zz\Html\HTMLMinify::DOCTYPE_HTML5,
3631
'optimizationLevel' => zz\Html\HTMLMinify::OPTIMIZATION_ADVANCED

0 commit comments

Comments
 (0)