aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 7452c82a..349229f3 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -146,16 +146,10 @@ class WallabagRestController extends Controller
146 { 146 {
147 $url = $request->request->get('url'); 147 $url = $request->request->get('url');
148 148
149 $content = $this->get('wallabag_core.graby')->fetchContent($url); 149 $entry = $this->get('wallabag_core.content_proxy')->updateEntry(
150 150 new Entry($this->getUser()),
151 $entry = new Entry($this->getUser()); 151 $url
152 $entry->setUrl($content['url'] ?: $url); 152 );
153 $entry->setTitle($request->request->get('title') ?: $content['title']);
154 $entry->setContent($content['html']);
155 $entry->setMimetype($content['content_type']);
156 if (isset($content['open_graph']['og_image'])) {
157 $entry->setPreviewPicture($content['open_graph']['og_image']);
158 }
159 153
160 $tags = $request->request->get('tags', ''); 154 $tags = $request->request->get('tags', '');
161 if (!empty($tags)) { 155 if (!empty($tags)) {