aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/EntryController.php
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2017-11-26 23:20:23 +0100
committerKevin Decherf <kevin@kdecherf.com>2017-12-13 22:44:31 +0100
commitaf29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6 (patch)
treeb4e0a8e01717f3d8d96138033bf8ce1696a127a7 /src/Wallabag/CoreBundle/Controller/EntryController.php
parent70265817aee257e7e635eda79ce3e037e3b4a242 (diff)
downloadwallabag-af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6.tar.gz
wallabag-af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6.tar.zst
wallabag-af29e1bf07aabaa6a4e4653c1a3b5c10ce831bb6.zip
Fix empty title and domain_name when exception is thrown during fetch
Add a new helper to set a default title when it's empty: 1/ use basename part of entry's path, if any 2/ or use domain name Fixes #2053 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 840dc254..b7fdea27 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -502,6 +502,14 @@ class EntryController extends Controller
502 $message = 'flashes.entry.notice.' . $prefixMessage . '_failed'; 502 $message = 'flashes.entry.notice.' . $prefixMessage . '_failed';
503 } 503 }
504 504
505 if (empty($entry->getDomainName())) {
506 $this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
507 }
508
509 if (empty($entry->getTitle())) {
510 $this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
511 }
512
505 $this->get('session')->getFlashBag()->add('notice', $message); 513 $this->get('session')->getFlashBag()->add('notice', $message);
506 } 514 }
507 515