decode before encoding URLs, closes #2440

This commit is contained in:
Dane Everitt 2020-10-03 12:51:41 -07:00
parent 99c9682f67
commit 4ff5de7e1b
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -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']