File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Backpack \FileManager ;
4+
5+ use Illuminate \Support \Facades \Crypt ;
6+ use Illuminate \Support \Facades \Log ;
7+
8+ class BackpackElfinderController extends \Barryvdh \Elfinder \ElfinderController
9+ {
10+ public function showPopup ($ input_id )
11+ {
12+ $ mimes = request ('mimes ' );
13+
14+ try {
15+ $ mimes = Crypt::decrypt (urldecode (request ('mimes ' )));
16+ } catch (\Illuminate \Contracts \Encryption \DecryptException $ e ) {
17+ Log::error ('Someone attempted to tamper with mime types in elfinder popup. The attempt was blocked. ' );
18+ abort (403 , 'Unauthorized action. ' );
19+ }
20+
21+ request ()->merge (['mimes ' => urlencode (serialize ($ mimes ))]);
22+
23+ return $ this ->app ['view ' ]
24+ ->make ($ this ->package .'::standalonepopup ' )
25+ ->with ($ this ->getViewVars ())
26+ ->with (compact ('input_id ' ));
27+ }
28+ }
Original file line number Diff line number Diff line change 33namespace Backpack \FileManager ;
44
55use Backpack \Basset \Facades \Basset ;
6+ use Barryvdh \Elfinder \ElfinderController ;
67use Illuminate \Support \Facades \Config ;
78use Illuminate \Support \ServiceProvider ;
89
910class FileManagerServiceProvider extends ServiceProvider
1011{
1112 protected $ commands = [
12- \ Backpack \ FileManager \ Console \Commands \Install::class,
13+ Console \Commands \Install::class,
1314 ];
1415
1516 /**
@@ -25,6 +26,11 @@ public function boot()
2526 }
2627 }
2728
29+ public function register ()
30+ {
31+ $ this ->app ->bind (ElfinderController::class, BackpackElfinderController::class);
32+ }
33+
2834 /**
2935 * Console-specific booting.
3036 *
You can’t perform that action at this time.
0 commit comments