Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_texteditor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2015-09-01 15:18:56 +0300
committerTom Needham <needham.thomas@gmail.com>2015-09-01 15:18:56 +0300
commit4b1a3c3cf4abe73d1527522138fd26fc9c87b385 (patch)
tree339111233c7aee89c1a19b7dce064a12caf3daea
parent2266998ce6bb8230af2e957d47b35b143a8dd2af (diff)
parentc0a0d40e6298be28376e59dde4ed86c63c308cdb (diff)
Merge pull request #96 from owncloud/master-fix-path-disclosure
Do not show actual error message
-rw-r--r--controller/filehandlingcontroller.php3
-rw-r--r--tests/controller/filehandlingcontrollertest.php2
2 files changed, 2 insertions, 3 deletions
diff --git a/controller/filehandlingcontroller.php b/controller/filehandlingcontroller.php
index 4d34759..e1ac927 100644
--- a/controller/filehandlingcontroller.php
+++ b/controller/filehandlingcontroller.php
@@ -103,8 +103,7 @@ class FileHandlingController extends Controller{
}
} catch (\Exception $e) {
- $hint = method_exists($e, 'getHint') ? $e->getHint() : $e->getMessage();
- return new DataResponse(['message' => (string)$hint], Http::STATUS_BAD_REQUEST);
+ return new DataResponse(['message' => 'An internal server error occurred.'], Http::STATUS_BAD_REQUEST);
}
}
diff --git a/tests/controller/filehandlingcontrollertest.php b/tests/controller/filehandlingcontrollertest.php
index 729a52d..8f9617b 100644
--- a/tests/controller/filehandlingcontrollertest.php
+++ b/tests/controller/filehandlingcontrollertest.php
@@ -131,7 +131,7 @@ class FileHandlingControllerTest extends TestCase {
$this->assertSame(400, $result->getStatus());
$this->assertArrayHasKey('message', $data);
- $this->assertSame($exceptionHint, $data['message']);
+ $this->assertSame('An internal server error occurred.', $data['message']);
}
/**