diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-10-23 11:09:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 11:09:17 +0200 |
commit | 1953a872932a63792293b4aec087880265ba89f7 (patch) | |
tree | fd16599e737fcdaf193c933ef3ec4a4ee248b117 /src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |
parent | d83d25dadec2c38460a32d96f5d2903426fec9d3 (diff) | |
parent | 702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff) | |
download | wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.gz wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.zst wallabag-1953a872932a63792293b4aec087880265ba89f7.zip |
Merge pull request #3011 from wallabag/2.3
wallabag 2.3.0
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/WallabagRestController.php')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index b1e08ca4..7d8cfbba 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -19,7 +19,7 @@ class WallabagRestController extends FOSRestController | |||
19 | public function getVersionAction() | 19 | public function getVersionAction() |
20 | { | 20 | { |
21 | $version = $this->container->getParameter('wallabag_core.version'); | 21 | $version = $this->container->getParameter('wallabag_core.version'); |
22 | $json = $this->get('serializer')->serialize($version, 'json'); | 22 | $json = $this->get('jms_serializer')->serialize($version, 'json'); |
23 | 23 | ||
24 | return (new JsonResponse())->setJson($json); | 24 | return (new JsonResponse())->setJson($json); |
25 | } | 25 | } |
@@ -40,8 +40,8 @@ class WallabagRestController extends FOSRestController | |||
40 | protected function validateUserAccess($requestUserId) | 40 | protected function validateUserAccess($requestUserId) |
41 | { | 41 | { |
42 | $user = $this->get('security.token_storage')->getToken()->getUser(); | 42 | $user = $this->get('security.token_storage')->getToken()->getUser(); |
43 | if ($requestUserId != $user->getId()) { | 43 | if ($requestUserId !== $user->getId()) { |
44 | throw $this->createAccessDeniedException('Access forbidden. Entry user id: '.$requestUserId.', logged user id: '.$user->getId()); | 44 | throw $this->createAccessDeniedException('Access forbidden. Entry user id: ' . $requestUserId . ', logged user id: ' . $user->getId()); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |