From d13de40db6fe5a006eb050908450b7adf3fcbf6c Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 24 Aug 2015 19:52:31 +0200 Subject: Update url from graby --- src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 2 +- src/Wallabag/CoreBundle/Controller/EntryController.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 9ca008bf..7452c82a 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -149,7 +149,7 @@ class WallabagRestController extends Controller $content = $this->get('wallabag_core.graby')->fetchContent($url); $entry = new Entry($this->getUser()); - $entry->setUrl($url); + $entry->setUrl($content['url'] ?: $url); $entry->setTitle($request->request->get('title') ?: $content['title']); $entry->setContent($content['html']); $entry->setMimetype($content['content_type']); diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 8e714763..e6580a57 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -32,6 +32,7 @@ class EntryController extends Controller if ($form->isValid()) { $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl()); + $entry->setUrl($content['url'] ?: $entry->getUrl()); $entry->setTitle($content['title']); $entry->setContent($content['html']); $entry->setMimetype($content['content_type']); -- cgit v1.2.3