diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-08-24 19:52:31 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-08-24 19:52:31 +0200 |
commit | d13de40db6fe5a006eb050908450b7adf3fcbf6c (patch) | |
tree | 3eb9f073850c83ccbdf064cf3ee2d26087b8af8d /src | |
parent | a1413a3da9e845a0f2e00e73069f5363864367bd (diff) | |
download | wallabag-d13de40db6fe5a006eb050908450b7adf3fcbf6c.tar.gz wallabag-d13de40db6fe5a006eb050908450b7adf3fcbf6c.tar.zst wallabag-d13de40db6fe5a006eb050908450b7adf3fcbf6c.zip |
Update url from graby
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 1 |
2 files changed, 2 insertions, 1 deletions
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 | |||
149 | $content = $this->get('wallabag_core.graby')->fetchContent($url); | 149 | $content = $this->get('wallabag_core.graby')->fetchContent($url); |
150 | 150 | ||
151 | $entry = new Entry($this->getUser()); | 151 | $entry = new Entry($this->getUser()); |
152 | $entry->setUrl($url); | 152 | $entry->setUrl($content['url'] ?: $url); |
153 | $entry->setTitle($request->request->get('title') ?: $content['title']); | 153 | $entry->setTitle($request->request->get('title') ?: $content['title']); |
154 | $entry->setContent($content['html']); | 154 | $entry->setContent($content['html']); |
155 | $entry->setMimetype($content['content_type']); | 155 | $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 | |||
32 | if ($form->isValid()) { | 32 | if ($form->isValid()) { |
33 | $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl()); | 33 | $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl()); |
34 | 34 | ||
35 | $entry->setUrl($content['url'] ?: $entry->getUrl()); | ||
35 | $entry->setTitle($content['title']); | 36 | $entry->setTitle($content['title']); |
36 | $entry->setContent($content['html']); | 37 | $entry->setContent($content['html']); |
37 | $entry->setMimetype($content['content_type']); | 38 | $entry->setMimetype($content['content_type']); |