diff options
author | Joas Schilling <coding@schilljs.com> | 2017-08-29 13:25:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-29 13:25:24 +0200 |
commit | 79a7b7f192e0b6e3b0c2c5fe76b8331b531c4cda (patch) | |
tree | 38bf14a0792f04bec231a25459a23cce78fd4151 | |
parent | 7d8b7d4e4ea83fc31ea64446e9085185c476de09 (diff) | |
parent | 0aff1c9268e760c2e1164f85ea8414ad0d1fa91c (diff) | |
download | nextcloud-server-79a7b7f192e0b6e3b0c2c5fe76b8331b531c4cda.tar.gz nextcloud-server-79a7b7f192e0b6e3b0c2c5fe76b8331b531c4cda.zip |
Merge pull request #6293 from nextcloud/less-user-enumeration
Return the user id in case of an error
-rw-r--r-- | core/Controller/AvatarController.php | 2 | ||||
-rw-r--r-- | tests/Core/Controller/AvatarControllerTest.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php index cb0ece9fa45..e4d13d218a5 100644 --- a/core/Controller/AvatarController.php +++ b/core/Controller/AvatarController.php @@ -143,7 +143,7 @@ class AvatarController extends Controller { } catch (\Exception $e) { $resp = new JSONResponse([ 'data' => [ - 'displayname' => '', + 'displayname' => $userId, ], ]); } diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index b87f73366fa..1a1f1130480 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -169,7 +169,7 @@ class AvatarControllerTest extends \Test\TestCase { //Comment out until JS is fixed //$this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus()); $this->assertEquals(Http::STATUS_OK, $response->getStatus()); - $this->assertEquals('', $response->getData()['data']['displayname']); + $this->assertEquals('userDoesNotExist', $response->getData()['data']['displayname']); } /** |