File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
app/Http/Controllers/Admin Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ public function create(MountFormRequest $request)
105105 $ model = (new Mount ())->fill ($ request ->validated ());
106106 $ model ->forceFill (['uuid ' => Uuid::uuid4 ()->toString ()]);
107107
108+ if (str_starts_with ($ model ->source , '/etc/pterodactyl ' )) {
109+ $ this ->alert ->danger ('Invalid source path: "/etc/pterodactyl" cannot be used as a source path. ' )->flash ();
110+ return redirect ()->route ('admin.mounts ' );
111+ }
112+
108113 if (str_starts_with ($ model ->source , '/var/lib/pterodactyl/volumes ' )) {
109114 $ this ->alert ->danger ('Invalid source path: "/var/lib/pterodactyl/volumes" cannot be used as a source path. ' )->flash ();
110115 return redirect ()->route ('admin.mounts ' );
@@ -145,6 +150,11 @@ public function update(MountFormRequest $request, Mount $mount)
145150
146151 $ mount ->forceFill ($ request ->validated ());
147152
153+ if (str_starts_with ($ mount ->source , '/etc/pterodactyl ' )) {
154+ $ this ->alert ->danger ('Invalid source path: "/etc/pterodactyl" cannot be used as a source path. ' )->flash ();
155+ return redirect ()->route ('admin.mounts.view ' , $ mount ->id );
156+ }
157+
148158 if (str_starts_with ($ mount ->source , '/var/lib/pterodactyl/volumes ' )) {
149159 $ this ->alert ->danger ('Invalid source path: "/var/lib/pterodactyl/volumes" cannot be used as a source path. ' )->flash ();
150160 return redirect ()->route ('admin.mounts.view ' , $ mount ->id );
You can’t perform that action at this time.
0 commit comments