diff options
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 02a6de64..349229f3 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -8,7 +8,6 @@ use Symfony\Component\HttpFoundation\Request; | |||
8 | use Symfony\Component\HttpFoundation\Response; | 8 | use Symfony\Component\HttpFoundation\Response; |
9 | use Wallabag\CoreBundle\Entity\Entry; | 9 | use Wallabag\CoreBundle\Entity\Entry; |
10 | use Wallabag\CoreBundle\Entity\Tag; | 10 | use Wallabag\CoreBundle\Entity\Tag; |
11 | use Wallabag\CoreBundle\Service\Extractor; | ||
12 | use Hateoas\Configuration\Route; | 11 | use Hateoas\Configuration\Route; |
13 | use Hateoas\Representation\Factory\PagerfantaFactory; | 12 | use Hateoas\Representation\Factory\PagerfantaFactory; |
14 | 13 | ||
@@ -147,11 +146,10 @@ class WallabagRestController extends Controller | |||
147 | { | 146 | { |
148 | $url = $request->request->get('url'); | 147 | $url = $request->request->get('url'); |
149 | 148 | ||
150 | $content = Extractor::extract($url); | 149 | $entry = $this->get('wallabag_core.content_proxy')->updateEntry( |
151 | $entry = new Entry($this->getUser()); | 150 | new Entry($this->getUser()), |
152 | $entry->setUrl($url); | 151 | $url |
153 | $entry->setTitle($request->request->get('title') ?: $content->getTitle()); | 152 | ); |
154 | $entry->setContent($content->getBody()); | ||
155 | 153 | ||
156 | $tags = $request->request->get('tags', ''); | 154 | $tags = $request->request->get('tags', ''); |
157 | if (!empty($tags)) { | 155 | if (!empty($tags)) { |