diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 9ca008bfd..7452c82af 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 8e7147630..e6580a579 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']);