1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-22 17:18:37 +00:00

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>
This commit is contained in:
Kevin Decherf 2017-11-26 23:20:23 +01:00
parent 70265817ae
commit af29e1bf07
4 changed files with 59 additions and 4 deletions

View file

@ -502,6 +502,14 @@ class EntryController extends Controller
$message = 'flashes.entry.notice.' . $prefixMessage . '_failed';
}
if (empty($entry->getDomainName())) {
$this->get('wallabag_core.content_proxy')->setEntryDomainName($entry);
}
if (empty($entry->getTitle())) {
$this->get('wallabag_core.content_proxy')->setDefaultEntryTitle($entry);
}
$this->get('session')->getFlashBag()->add('notice', $message);
}