From c69f48ad832f66f7f67644f505262d7575423f22 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 21 Jan 2018 12:31:41 -0600 Subject: [PATCH] Fix filemanager file edit bug, closes #867 --- CHANGELOG.md | 1 + app/Contracts/Repository/Daemon/FileRepositoryInterface.php | 4 ++-- app/Repositories/Daemon/FileRepository.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e258be272..1c17ac992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines. ### Fixed * `[beta.4]` — Fixes some bad search and replace action that happened previously and was throwing errors when validating user permissions. * `[beta.4]` — Fixes behavior of variable validation to not break the page when no rules are provided. +* `[beta.4]` — Fix bug preventing the editing of files in the file manager. ## v0.7.0-beta.4 (Derelict Dermodactylus) ### Fixed diff --git a/app/Contracts/Repository/Daemon/FileRepositoryInterface.php b/app/Contracts/Repository/Daemon/FileRepositoryInterface.php index aba7af0ea..8573daf61 100644 --- a/app/Contracts/Repository/Daemon/FileRepositoryInterface.php +++ b/app/Contracts/Repository/Daemon/FileRepositoryInterface.php @@ -21,11 +21,11 @@ interface FileRepositoryInterface extends BaseRepositoryInterface * Return the contents of a given file if it can be edited in the Panel. * * @param string $path - * @return \stdClass + * @return string * * @throws \GuzzleHttp\Exception\RequestException */ - public function getContent(string $path): stdClass; + public function getContent(string $path): string; /** * Save new contents to a given file. diff --git a/app/Repositories/Daemon/FileRepository.php b/app/Repositories/Daemon/FileRepository.php index 2f702d13d..8350e402f 100644 --- a/app/Repositories/Daemon/FileRepository.php +++ b/app/Repositories/Daemon/FileRepository.php @@ -33,11 +33,11 @@ class FileRepository extends BaseRepository implements FileRepositoryInterface * Return the contents of a given file if it can be edited in the Panel. * * @param string $path - * @return \stdClass + * @return string * * @throws \GuzzleHttp\Exception\RequestException */ - public function getContent(string $path): stdClass + public function getContent(string $path): string { $file = pathinfo($path); $file['dirname'] = in_array($file['dirname'], ['.', './', '/']) ? null : trim($file['dirname'], '/') . '/';