forked from wallabag/wallabag
Allow other fields to be send using API
Entry API can now have these new fields: - content - language - preview_picture - published_at Re-use the ContentProxy to be able to do the same using the web UI (in the future). htmLawed is used to clean stuff from content, I hope it’ll be enough to avoid security breach. Lower content validation when we want to update an entry with content already defined. Before, language & content_type were required. If there weren’t provided, we re-fetched the content using graby. I think these fields aren’t required for an entry to be created. So I removed them. Which means some import from the v1 export won’t be re-fetched since they provide content, url & title. Also, remove liberation link from Readability import to avoid overlaping import (from wallabag v1, which had the same link)
This commit is contained in:
@ -112,16 +112,16 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findByUrlAndUserId(
|
||||
'https://framablog.org/2014/02/05/framabag-service-libre-gratuit-interview-developpeur/',
|
||||
'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur',
|
||||
$this->getLoggedInUserId()
|
||||
);
|
||||
|
||||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertContains('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is ok');
|
||||
$this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is ok');
|
||||
$this->assertNotEmpty($content->getLanguage(), 'Language for http://www.framablog.org is ok');
|
||||
$this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.framablog.org is empty');
|
||||
$this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.framablog.org is empty');
|
||||
$this->assertEmpty($content->getLanguage(), 'Language for http://www.framablog.org is empty');
|
||||
|
||||
$tags = $content->getTags();
|
||||
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
|
||||
|
||||
Reference in New Issue
Block a user