File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
1
<?php namespace Backend \Traits ;
2
2
3
- use Str ;
3
+ use ApplicationException ;
4
+ use Event ;
4
5
use File ;
6
+ use Illuminate \Filesystem \FilesystemAdapter ;
5
7
use Lang ;
6
- use Event ;
7
- use Config ;
8
- use Storage ;
9
8
use Request ;
10
9
use Response ;
11
- use ApplicationException ;
10
+ use Str ;
12
11
use System \Classes \MediaLibrary ;
13
- use Illuminate \Filesystem \FilesystemAdapter ;
14
12
use Winter \Storm \Filesystem \Definitions as FileDefinitions ;
13
+ use Winter \Storm \Support \Svg ;
15
14
16
15
/**
17
16
* Uploadable Widget Trait
@@ -124,6 +123,11 @@ protected function onUploadDirect(): \Illuminate\Http\Response
124
123
125
124
$ filePath = $ this ->uploadableGetUploadPath ($ fileName );
126
125
126
+ // Filter SVG files
127
+ if (pathinfo ($ filePath , PATHINFO_EXTENSION ) === 'svg ' ) {
128
+ file_put_contents ($ sourcePath , Svg::extract ($ sourcePath ));
129
+ }
130
+
127
131
$ this ->uploadableGetDisk ()->put ($ filePath , File::get ($ sourcePath ));
128
132
129
133
/**
You can’t perform that action at this time.
0 commit comments