Fix bad encoding when handling files; closes #2399
This commit is contained in:
parent
711efe34bb
commit
3340ee7fd8
2 changed files with 5 additions and 5 deletions
|
@ -70,7 +70,7 @@ class FileController extends ClientApiController
|
||||||
{
|
{
|
||||||
$contents = $this->fileRepository
|
$contents = $this->fileRepository
|
||||||
->setServer($server)
|
->setServer($server)
|
||||||
->getDirectory($request->get('directory') ?? '/');
|
->getDirectory(urlencode($request->get('directory') ?? '/'));
|
||||||
|
|
||||||
return $this->fractal->collection($contents)
|
return $this->fractal->collection($contents)
|
||||||
->transformWith($this->getTransformer(FileObjectTransformer::class))
|
->transformWith($this->getTransformer(FileObjectTransformer::class))
|
||||||
|
@ -91,7 +91,7 @@ class FileController extends ClientApiController
|
||||||
{
|
{
|
||||||
return new Response(
|
return new Response(
|
||||||
$this->fileRepository->setServer($server)->getContent(
|
$this->fileRepository->setServer($server)->getContent(
|
||||||
$request->get('file'), config('pterodactyl.files.max_edit_size')
|
urlencode($request->get('file')), config('pterodactyl.files.max_edit_size')
|
||||||
),
|
),
|
||||||
Response::HTTP_OK,
|
Response::HTTP_OK,
|
||||||
['Content-Type' => 'text/plain']
|
['Content-Type' => 'text/plain']
|
||||||
|
|
|
@ -117,8 +117,8 @@ class DaemonFileRepository extends DaemonRepository
|
||||||
sprintf('/api/servers/%s/files/create-directory', $this->server->uuid),
|
sprintf('/api/servers/%s/files/create-directory', $this->server->uuid),
|
||||||
[
|
[
|
||||||
'json' => [
|
'json' => [
|
||||||
'name' => urldecode($name),
|
'name' => $name,
|
||||||
'path' => urldecode($path),
|
'path' => $path,
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -172,7 +172,7 @@ class DaemonFileRepository extends DaemonRepository
|
||||||
sprintf('/api/servers/%s/files/copy', $this->server->uuid),
|
sprintf('/api/servers/%s/files/copy', $this->server->uuid),
|
||||||
[
|
[
|
||||||
'json' => [
|
'json' => [
|
||||||
'location' => urldecode($location),
|
'location' => $location,
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue