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

Commit 55861a0

Browse files
author
Otis Wright
authored
Create SS_RelativeAssetsResponse.php
1 parent 3285763 commit 55861a0

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

code/SS_RelativeAssetsResponse.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* Class SS_RelativeAssetsResponseExtension
5+
*
6+
* @property Controller $owner
7+
*/
8+
class SS_RelativeAssetsResponseExtension extends Extension
9+
{
10+
11+
function onBeforeInit()
12+
{
13+
if (is_a($this->owner, 'Controller')) {
14+
$this->owner->response = new SS_RelativeAssetsResponse();
15+
}
16+
}
17+
18+
}
19+
20+
class SS_RelativeAssetsResponse extends SS_HTTPResponse
21+
{
22+
public function setBody($body)
23+
{
24+
$this->body = $body ? (string)$body : $body;
25+
26+
//
27+
$this->body = str_replace('"/assets/', '"assets/', $this->body);
28+
$this->body = str_replace('"assets/', '"/assets/', $this->body);
29+
}
30+
31+
32+
}

0 commit comments

Comments
 (0)