File tree Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Expand file tree Collapse file tree 1 file changed +2
-19
lines changed Original file line number Diff line number Diff line change 15
15
use Flarum \Api \Serializer \BasicPostSerializer ;
16
16
use Flarum \Formatter \Event \Configuring ;
17
17
use Flarum \Http \UrlGenerator ;
18
- use Flarum \Settings \SettingsRepositoryInterface ;
19
18
use Illuminate \Contracts \Events \Dispatcher ;
20
19
21
20
class ModifyContentHtml
22
21
{
23
22
private $ regex = '/<img src="http:\/\/(.+?)" title="(.*?)" alt="(.*?)">/ ' ;
24
23
25
- /**
26
- * @var UrlGenerator
27
- */
28
- private $ url ;
29
-
30
- /**
31
- * @var SettingsRepositoryInterface
32
- */
33
- private $ settings ;
34
-
35
- public function __construct (UrlGenerator $ url , SettingsRepositoryInterface $ settings )
36
- {
37
- $ this ->url = $ url ;
38
- $ this ->settings = $ settings ;
39
- }
40
-
41
24
public function subscribe (Dispatcher $ events )
42
25
{
43
26
$ events ->listen (Configuring::class, [$ this , 'configuring ' ]);
@@ -64,7 +47,7 @@ public function configuring(Configuring $configuring)
64
47
65
48
$ tag ->attributes ['src ' ]->filterChain
66
49
->append ([$ this , 'replaceUrl ' ])
67
- ->addParameterByValue ($ this -> url ->to ('api ' )->path ('fof/secure-https/ ' ));
50
+ ->addParameterByValue (app (UrlGenerator::class) ->to ('api ' )->path ('fof/secure-https/ ' ));
68
51
}
69
52
}
70
53
@@ -75,6 +58,6 @@ public function replaceUrl($attrValue, $proxyUrl)
75
58
76
59
private function isProxyEnabled ()
77
60
{
78
- return (bool ) $ this -> settings ->get ('fof-secure-https.proxy ' );
61
+ return (bool ) app ( ' flarum. settings' ) ->get ('fof-secure-https.proxy ' );
79
62
}
80
63
}
You can’t perform that action at this time.
0 commit comments