diff options
author | Tom Needham <needham.thomas@gmail.com> | 2015-09-01 15:18:56 +0300 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2015-09-01 15:18:56 +0300 |
commit | 4b1a3c3cf4abe73d1527522138fd26fc9c87b385 (patch) | |
tree | 339111233c7aee89c1a19b7dce064a12caf3daea | |
parent | 2266998ce6bb8230af2e957d47b35b143a8dd2af (diff) | |
parent | c0a0d40e6298be28376e59dde4ed86c63c308cdb (diff) |
Merge pull request #96 from owncloud/master-fix-path-disclosure
Do not show actual error message
-rw-r--r-- | controller/filehandlingcontroller.php | 3 | ||||
-rw-r--r-- | tests/controller/filehandlingcontrollertest.php | 2 |
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']); } /** |