]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Update url from graby
authorJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 24 Aug 2015 17:52:31 +0000 (19:52 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 24 Aug 2015 17:52:31 +0000 (19:52 +0200)
src/Wallabag/ApiBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Controller/EntryController.php

index 9ca008bfdab5db3b195e7386d55df0bcdef468aa..7452c82af6b86f0b4e65a6e11a59a7feeb36cc70 100644 (file)
@@ -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']);
index 8e71476307425dc35ea042f44ee397c5e6157859..e6580a579b6821992c6207f078af5991fa548d53 100644 (file)
@@ -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']);