1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-01 17:38:38 +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

@ -501,6 +501,8 @@ class EntryRestControllerTest extends WallabagApiTestCase
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertGreaterThan(0, $content['id']);
$this->assertSame('http://www.example.com/', $content['url']);
$this->assertSame('www.example.com', $content['domain_name']);
$this->assertSame('www.example.com', $content['title']);
} finally {
// Remove the created entry to avoid side effects on other tests
if (isset($content['id'])) {