From 4ff5de7e1b6ba2c1eda8720c01fb8ff84f2be047 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 3 Oct 2020 12:51:41 -0700 Subject: [PATCH] decode before encoding URLs, closes #2440 --- app/Http/Controllers/Api/Client/Servers/FileController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/Client/Servers/FileController.php b/app/Http/Controllers/Api/Client/Servers/FileController.php index ed3c97b34..a175f390f 100644 --- a/app/Http/Controllers/Api/Client/Servers/FileController.php +++ b/app/Http/Controllers/Api/Client/Servers/FileController.php @@ -70,7 +70,7 @@ class FileController extends ClientApiController { $contents = $this->fileRepository ->setServer($server) - ->getDirectory(urlencode($request->get('directory') ?? '/')); + ->getDirectory(urlencode(urldecode($request->get('directory') ?? '/'))); return $this->fractal->collection($contents) ->transformWith($this->getTransformer(FileObjectTransformer::class)) @@ -91,7 +91,7 @@ class FileController extends ClientApiController { return new Response( $this->fileRepository->setServer($server)->getContent( - urlencode($request->get('file')), config('pterodactyl.files.max_edit_size') + urlencode(urldecode($request->get('file'))), config('pterodactyl.files.max_edit_size') ), Response::HTTP_OK, ['Content-Type' => 'text/plain']