X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FWallabagRestController.php;h=5202c524c68da16c0b2f0411e76ebbeeff1a7268;hb=51a15609b3bb0635e5cbea8511d983e2c5a97fe7;hp=fe3495f845aad65df2f5f37404474261dc9d36d1;hpb=5c3ca4fe9eb1db2fa11c0809c54538430b89b1fc;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index fe3495f8..5202c524 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -43,8 +43,8 @@ class WallabagRestController extends FOSRestController { $this->validateAuthentication(); - $isArchived = (null === $request->query->get('archive')) ? null : (bool) (int) $request->query->get('archive'); - $isStarred = (null === $request->query->get('starred')) ? null : (bool) (int) $request->query->get('starred'); + $isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive'); + $isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred'); $sort = $request->query->get('sort', 'created'); $order = $request->query->get('order', 'desc'); $page = (int) $request->query->get('page', 1); @@ -109,6 +109,7 @@ class WallabagRestController extends FOSRestController $this->validateAuthentication(); $url = $request->request->get('url'); + $title = $request->request->get('title'); $isArchived = (int) $request->request->get('archive'); $isStarred = (int) $request->request->get('starred'); @@ -121,6 +122,10 @@ class WallabagRestController extends FOSRestController ); } + if (!is_null($title)) { + $entry->setTitle($title); + } + $tags = $request->request->get('tags', ''); if (!empty($tags)) { $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags); @@ -384,6 +389,6 @@ class WallabagRestController extends FOSRestController */ private function renderJsonResponse($json) { - return new Response($json, 200, array('application/json')); + return new Response($json, 200, ['application/json']); } }